23 #include <winpr/winpr.h>
24 #include <winpr/wlog.h>
25 #include <winpr/platform.h>
30 #define FREERDP_ENTRY_POINT(fkt) \
35 #define FREERDP_CC __cdecl
40 #if defined _WIN32 || defined __CYGWIN__
41 #ifdef FREERDP_EXPORTS
43 #define FREERDP_API __attribute__((dllexport))
45 #define FREERDP_API __declspec(dllexport)
49 #define FREERDP_API __attribute__((dllimport))
51 #define FREERDP_API __declspec(dllimport)
55 #if defined(__GNUC__) && (__GNUC__ >= 4)
56 #define FREERDP_API __attribute__((visibility("default")))
62 #if defined(EXPORT_ALL_SYMBOLS)
63 #define FREERDP_LOCAL FREERDP_API
65 #if defined _WIN32 || defined __CYGWIN__
68 #if defined(__GNUC__) && (__GNUC__ >= 4)
69 #define FREERDP_LOCAL __attribute__((visibility("hidden")))
76 #define IFCALL(_cb, ...) \
82 WLog_VRB("com.freerdp.api", "IFCALL(" #_cb ") == NULL"); \
84 #define IFCALLRET(_cb, _ret, ...) \
88 _ret = _cb(__VA_ARGS__); \
90 WLog_VRB("com.freerdp.api", "IFCALLRET(" #_cb ") == NULL"); \
94 #define IFCALLRESULT(_default_return, _cb, ...) \
96 (_cb != NULL) ? _cb(__VA_ARGS__) : ({ \
97 WLog_VRB("com.freerdp.api", "IFCALLRESULT(" #_cb ") == NULL"); \
102 #define IFCALLRESULT(_default_return, _cb, ...) \
103 ((_cb != NULL) ? _cb(__VA_ARGS__) : (_default_return))
106 #if defined(__GNUC__) || defined(__clang__)
107 #define ALIGN64 __attribute__((aligned(8)))
110 #define ALIGN64 __declspec(align(8))