File tree 1 file changed +17
-3
lines changed
1 file changed +17
-3
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)))
111
-
112
- /// Name of the source file without a directory string.
113
- #define ET_SHORT_FILENAME (__builtin_strrchr("/" __FILE__, '/') + 1)
119
+ #endif
114
120
115
121
#ifndef __has_builtin
116
122
#define __has_builtin (x ) (0)
117
123
#endif
118
124
125
+ #if __has_builtin (__builtin_strrchr )
126
+ /// Name of the source file without a directory string.
127
+ #define ET_SHORT_FILENAME (__builtin_strrchr("/" __FILE__, '/') + 1)
128
+ #else
129
+ #include <cstring>
130
+ #define ET_SHORT_FILENAME (strchr("/" __FILE__, '/') + 1)
131
+ #endif
132
+
119
133
#if __has_builtin (__builtin_LINE )
120
134
/// Current line as an integer.
121
135
#define ET_LINE __builtin_LINE()
You can’t perform that action at this time.
0 commit comments