File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 100
100
#endif // (__cplusplus) >= 202002L
101
101
102
102
/// Define a C symbol with weak linkage.
103
+ #ifdef _WIN32
104
+ #define ET_WEAK
105
+ #else
103
106
#define ET_WEAK __attribute__((weak))
107
+ #endif
104
108
105
109
/**
106
110
* Annotation marking a function as printf-like, providing compiler support
107
111
* for format string argument checking.
108
112
*/
113
+ #ifdef _MSC_VER
114
+ #include <sal.h>
115
+ #define ET_PRINTFLIKE (_string_index , _va_index ) _Printf_format_string_
116
+ #else
109
117
#define ET_PRINTFLIKE (_string_index , _va_index ) \
110
118
__attribute__((format(printf, _string_index, _va_index)))
119
+ #endif
111
120
121
+ #if __has_builtin (__builtin_strrchr )
112
122
/// Name of the source file without a directory string.
113
123
#define ET_SHORT_FILENAME (__builtin_strrchr("/" __FILE__, '/') + 1)
124
+ #else
125
+ #include <cstring>
126
+ #define ET_SHORT_FILENAME (strchr("/" __FILE__, '/') + 1)
127
+ #endif
114
128
115
129
#ifndef __has_builtin
116
130
#define __has_builtin (x ) (0)
You can’t perform that action at this time.
0 commit comments