Fix symbol exportation and other things to make all tests pass on MSVC.

pull/216/head
Jussi Pakkanen 10 years ago
parent b7e391ead4
commit b6cb7fd29e
  1. 13
      test cases/common/46 library chain/subdir/lib1.c
  2. 13
      test cases/common/46 library chain/subdir/subdir2/lib2.c
  3. 13
      test cases/common/46 library chain/subdir/subdir3/lib3.c
  4. 17
      test cases/common/49 subproject/subprojects/sublib/include/subdefs.h
  5. 3
      test cases/common/49 subproject/subprojects/sublib/meson.build
  6. 2
      test cases/common/49 subproject/subprojects/sublib/sublib.c
  7. 13
      test cases/common/53 subproject subproject/subprojects/a/a.c
  8. 13
      test cases/common/53 subproject subproject/subprojects/b/b.c
  9. 6
      test cases/common/60 install script/meson.build
  10. 13
      test cases/common/62 exe static shared/subdir/shlib.c
  11. 14
      test cases/common/79 shared subproject/subprojects/B/b.c
  12. 13
      test cases/common/79 shared subproject/subprojects/C/c.c
  13. 13
      test cases/common/80 shared subproject 2/subprojects/B/b.c
  14. 13
      test cases/common/80 shared subproject 2/subprojects/C/c.c
  15. 13
      test cases/common/82 custom subproject dir/custom_subproject_dir/B/b.c
  16. 13
      test cases/common/82 custom subproject dir/custom_subproject_dir/C/c.c
  17. 13
      test cases/common/86 same basename/lib.c

@ -1,6 +1,17 @@
int lib2fun();
int lib3fun();
int libfun() {
#if defined _WIN32 || defined __CYGWIN__
#define DLL_PUBLIC __declspec(dllexport)
#else
#if defined __GNUC__
#define DLL_PUBLIC __attribute__ ((visibility("default")))
#else
#pragma message ("Compiler does not support symbol visibility.")
#define DLL_PUBLIC
#endif
#endif
int DLL_PUBLIC libfun() {
return lib2fun() + lib3fun();
}

@ -1,3 +1,14 @@
int lib2fun() {
#if defined _WIN32 || defined __CYGWIN__
#define DLL_PUBLIC __declspec(dllexport)
#else
#if defined __GNUC__
#define DLL_PUBLIC __attribute__ ((visibility("default")))
#else
#pragma message ("Compiler does not support symbol visibility.")
#define DLL_PUBLIC
#endif
#endif
int DLL_PUBLIC lib2fun() {
return 0;
}

@ -1,3 +1,14 @@
int lib3fun() {
#if defined _WIN32 || defined __CYGWIN__
#define DLL_PUBLIC __declspec(dllexport)
#else
#if defined __GNUC__
#define DLL_PUBLIC __attribute__ ((visibility("default")))
#else
#pragma message ("Compiler does not support symbol visibility.")
#define DLL_PUBLIC
#endif
#endif
int DLL_PUBLIC lib3fun() {
return 0;
}

@ -1,6 +1,21 @@
#ifndef SUBDEFS_H_
#define SUBDEFS_H_
int subfunc();
#if defined _WIN32 || defined __CYGWIN__
#if defined BUILDING_SUB
#define DLL_PUBLIC __declspec(dllexport)
#else
#define DLL_PUBLIC __declspec(dllimport)
#endif
#else
#if defined __GNUC__
#define DLL_PUBLIC __attribute__ ((visibility("default")))
#else
#pragma message ("Compiler does not support symbol visibility.")
#define DLL_PUBLIC
#endif
#endif
int DLL_PUBLIC subfunc();
#endif

@ -5,6 +5,7 @@ if not meson.is_subproject()
endif
i = include_directories('include')
l = shared_library('sublib', 'sublib.c', include_directories : i, install : true)
l = shared_library('sublib', 'sublib.c', include_directories : i, install : true,
c_args : '-DBUILDING_SUB=2')
t = executable('simpletest', 'simpletest.c', include_directories : i, link_with : l)
test('plain', t)

@ -1,5 +1,5 @@
#include<subdefs.h>
int subfunc() {
int DLL_PUBLIC subfunc() {
return 42;
}

@ -1,4 +1,15 @@
int func2();
int func() { return func2(); }
#if defined _WIN32 || defined __CYGWIN__
#define DLL_PUBLIC __declspec(dllexport)
#else
#if defined __GNUC__
#define DLL_PUBLIC __attribute__ ((visibility("default")))
#else
#pragma message ("Compiler does not support symbol visibility.")
#define DLL_PUBLIC
#endif
#endif
int DLL_PUBLIC func() { return func2(); }

@ -1,3 +1,14 @@
int func2() {
#if defined _WIN32 || defined __CYGWIN__
#define DLL_PUBLIC __declspec(dllexport)
#else
#if defined __GNUC__
#define DLL_PUBLIC __attribute__ ((visibility("default")))
#else
#pragma message ("Compiler does not support symbol visibility.")
#define DLL_PUBLIC
#endif
#endif
int DLL_PUBLIC func2() {
return 42;
}

@ -1,4 +1,8 @@
project('custom install script', 'c')
meson.set_install_script('myinstall.sh')
if meson.get_compiler('c').get_id() == 'msvc'
meson.set_install_script('myinstall.bat')
else
meson.set_install_script('myinstall.sh')
endif
executable('prog', 'prog.c', install : true)

@ -1,3 +1,14 @@
int shlibfunc() {
#if defined _WIN32 || defined __CYGWIN__
#define DLL_PUBLIC __declspec(dllexport)
#else
#if defined __GNUC__
#define DLL_PUBLIC __attribute__ ((visibility("default")))
#else
#pragma message ("Compiler does not support symbol visibility.")
#define DLL_PUBLIC
#endif
#endif
int DLL_PUBLIC shlibfunc() {
return 42;
}

@ -1,7 +1,19 @@
#include<stdlib.h>
#if defined _WIN32 || defined __CYGWIN__
#define DLL_PUBLIC __declspec(dllexport)
#else
#if defined __GNUC__
#define DLL_PUBLIC __attribute__ ((visibility("default")))
#else
#pragma message ("Compiler does not support symbol visibility.")
#define DLL_PUBLIC
#endif
#endif
char func_c();
char func_b() {
char DLL_PUBLIC func_b() {
if(func_c() != 'c') {
exit(3);
}

@ -1,3 +1,14 @@
char func_c() {
#if defined _WIN32 || defined __CYGWIN__
#define DLL_PUBLIC __declspec(dllexport)
#else
#if defined __GNUC__
#define DLL_PUBLIC __attribute__ ((visibility("default")))
#else
#pragma message ("Compiler does not support symbol visibility.")
#define DLL_PUBLIC
#endif
#endif
char DLL_PUBLIC func_c() {
return 'c';
}

@ -1,7 +1,18 @@
#include<stdlib.h>
char func_c();
char func_b() {
#if defined _WIN32 || defined __CYGWIN__
#define DLL_PUBLIC __declspec(dllexport)
#else
#if defined __GNUC__
#define DLL_PUBLIC __attribute__ ((visibility("default")))
#else
#pragma message ("Compiler does not support symbol visibility.")
#define DLL_PUBLIC
#endif
#endif
char DLL_PUBLIC func_b() {
if(func_c() != 'c') {
exit(3);
}

@ -1,3 +1,14 @@
char func_c() {
#if defined _WIN32 || defined __CYGWIN__
#define DLL_PUBLIC __declspec(dllexport)
#else
#if defined __GNUC__
#define DLL_PUBLIC __attribute__ ((visibility("default")))
#else
#pragma message ("Compiler does not support symbol visibility.")
#define DLL_PUBLIC
#endif
#endif
char DLL_PUBLIC func_c() {
return 'c';
}

@ -1,7 +1,18 @@
#include<stdlib.h>
char func_c();
char func_b() {
#if defined _WIN32 || defined __CYGWIN__
#define DLL_PUBLIC __declspec(dllexport)
#else
#if defined __GNUC__
#define DLL_PUBLIC __attribute__ ((visibility("default")))
#else
#pragma message ("Compiler does not support symbol visibility.")
#define DLL_PUBLIC
#endif
#endif
char DLL_PUBLIC func_b() {
if(func_c() != 'c') {
exit(3);
}

@ -1,3 +1,14 @@
char func_c() {
#if defined _WIN32 || defined __CYGWIN__
#define DLL_PUBLIC __declspec(dllexport)
#else
#if defined __GNUC__
#define DLL_PUBLIC __attribute__ ((visibility("default")))
#else
#pragma message ("Compiler does not support symbol visibility.")
#define DLL_PUBLIC
#endif
#endif
char DLL_PUBLIC func_c() {
return 'c';
}

@ -1,5 +1,16 @@
#if defined _WIN32 || defined __CYGWIN__
#define DLL_PUBLIC __declspec(dllexport)
#else
#if defined __GNUC__
#define DLL_PUBLIC __attribute__ ((visibility("default")))
#else
#pragma message ("Compiler does not support symbol visibility.")
#define DLL_PUBLIC
#endif
#endif
#if defined SHAR
int func() {
int DLL_PUBLIC func() {
return 1;
}
#elif defined STAT

Loading…
Cancel
Save