parent
b7e391ead4
commit
b6cb7fd29e
17 changed files with 181 additions and 17 deletions
@ -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 |
||||
|
@ -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,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,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,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'; |
||||
} |
||||
|
Loading…
Reference in new issue