Commit 836c1304903cc1efcb666ab8b2a6fe9ff8938ee8
1 parent
1241cdd4
Exists in
master
and in
5 other branches
Melhorando detecção dos atributos de exportação
Showing
2 changed files
with
21 additions
and
15 deletions
Show diff stats
configure.ac
... | ... | @@ -214,20 +214,21 @@ rm -f conftest.$ac_objext conftest.err m4_ifval([$1], [conftest.$ac_ext])[]dnl |
214 | 214 | |
215 | 215 | AC_MSG_CHECKING(for GNUC visibility attribute) |
216 | 216 | GLIB_CHECK_COMPILE_WARNINGS([AC_LANG_SOURCE([ |
217 | -void | |
218 | -__attribute__ ((visibility ("hidden"))) | |
219 | - f_hidden (void) | |
220 | -{ | |
221 | -} | |
222 | -void | |
223 | -__attribute__ ((visibility ("default"))) | |
224 | - f_default (void) | |
225 | -{ | |
226 | -} | |
217 | + | |
218 | +#define LIB3270_INTERNAL extern __attribute__((visibility("hidden"))) | |
219 | +#define LIB3270_EXPORT extern __attribute__((visibility("default"))) | |
220 | + | |
221 | +LIB3270_INTERNAL void f_hidden(void); | |
222 | +LIB3270_EXPORT void f_export(void); | |
223 | + | |
224 | +void f_hidden (void) { } | |
225 | + | |
226 | +void f_export (void) { } | |
227 | + | |
227 | 228 | int main (int argc, char **argv) |
228 | 229 | { |
229 | 230 | f_hidden(); |
230 | - f_internal(); | |
231 | + f_export(); | |
231 | 232 | return 0; |
232 | 233 | } |
233 | 234 | ])],g_have_gnuc_visibility=yes,g_have_gnuc_visibility=no) | ... | ... |
src/include/lib3270.h
... | ... | @@ -284,20 +284,25 @@ |
284 | 284 | |
285 | 285 | #if defined( ANDROID ) |
286 | 286 | |
287 | - #define LIB3270_EXPORT extern __attribute__((visibility("hidden"))) | |
287 | + #define LIB3270_INTERNAL extern __attribute__((visibility("hidden"))) | |
288 | + #define LIB3270_EXPORT extern __attribute__((visibility("hidden"))) | |
288 | 289 | |
289 | 290 | #elif defined(_WIN32) |
290 | 291 | |
291 | 292 | #include <windows.h> |
292 | - #define LIB3270_EXPORT extern __declspec (dllexport) | |
293 | + | |
294 | + #define LIB3270_INTERNAL extern | |
295 | + #define LIB3270_EXPORT extern __declspec (dllexport) | |
293 | 296 | |
294 | 297 | #elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550) |
295 | 298 | |
296 | - #define LIB3270_EXPORT extern | |
299 | + #define LIB3270_INTERNAL extern | |
300 | + #define LIB3270_EXPORT extern | |
297 | 301 | |
298 | 302 | #elif defined (HAVE_GNUC_VISIBILITY) |
299 | 303 | |
300 | - #define LIB3270_EXPORT extern __attribute__((visibility("default"))) | |
304 | + #define LIB3270_INTERNAL extern __attribute__((visibility("hidden"))) | |
305 | + #define LIB3270_EXPORT extern __attribute__((visibility("default"))) | |
301 | 306 | |
302 | 307 | #else |
303 | 308 | ... | ... |