Commit 2bf2f4d2d9d77d5e495d3bc21efd5f3c59a20311

Authored by Perry Werneck
2 parents 71b94e2c 027b213b

Merge branch 'master' into CVE-2019-15525

Showing 1 changed file with 24 additions and 8 deletions   Show diff stats
src/include/lib3270.h
... ... @@ -47,26 +47,39 @@
47 47 #define ENOTCONN 126
48 48 #endif // !ENOTCONN
49 49  
  50 + #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1) || defined (__clang__)
  51 +
  52 + #define LIB3270_DEPRECATED(func) func __attribute__ ((deprecated))
  53 +
  54 + #elif defined(_WIN32)
  55 +
  56 + #define LIB3270_DEPRECATED(func) __declspec(deprecated) func
  57 +
  58 + #else
  59 +
  60 + #define LIB3270_DEPRECATED(func) func
  61 +
  62 + #endif /* __GNUC__ */
  63 +
50 64 #if defined(__GNUC__)
51 65  
52 66 #define LIB3270_GNUC_FORMAT(s,f) __attribute__ ((__format__ (__printf__, s, f)))
53   - #define LIB3270_DEPRECATED(func) func __attribute__ ((deprecated))
54 67 #define LIB3270_GNUC_NULL_TERMINATED __attribute__((__sentinel__))
55 68  
56 69 #elif defined(_WIN32)
57 70  
58   - #define LIB3270_DEPRECATED(func) __declspec(deprecated) func
59 71 #define LIB3270_GNUC_NULL_TERMINATED __attribute__((__sentinel__))
  72 + #define LIB3270_GNUC_FORMAT(s,f)
60 73  
61 74 #elif defined(__LCLINT__)
62 75  
63   - #define LIB3270_DEPRECATED(func) func
64 76 #define LIB3270_GNUC_NULL_TERMINATED
  77 + #define LIB3270_GNUC_FORMAT(s,f)
65 78  
66 79 #else
67 80  
68   - #define LIB3270_DEPRECATED(func) func
69 81 #define LIB3270_GNUC_NULL_TERMINATED
  82 + #define LIB3270_GNUC_FORMAT(s,f)
70 83  
71 84 #endif
72 85  
... ... @@ -322,9 +335,7 @@
322 335 #define LIB3270_INTERNAL extern __attribute__((visibility("hidden")))
323 336 #define LIB3270_EXPORT extern __attribute__((visibility("hidden")))
324 337  
325   - #elif defined(_WIN32)
326   -
327   - #include <windows.h>
  338 + #elif defined(_WIN32) || defined(_MSC_VER)
328 339  
329 340 #define LIB3270_INTERNAL extern
330 341 #define LIB3270_EXPORT extern __declspec (dllexport)
... ... @@ -334,11 +345,16 @@
334 345 #define LIB3270_INTERNAL __hidden extern
335 346 #define LIB3270_EXPORT extern
336 347  
337   - #else
  348 + #elif defined(__GNUC__) || defined(HAVE_GNUC_VISIBILITY)
338 349  
339 350 #define LIB3270_INTERNAL __attribute__((visibility("hidden"))) extern
340 351 #define LIB3270_EXPORT __attribute__((visibility("default"))) extern
341 352  
  353 + #else
  354 +
  355 + #define LIB3270_INTERNAL
  356 + #define LIB3270_EXPORT
  357 +
342 358 #endif
343 359  
344 360 /**
... ...