File tree 1 file changed +19
-3
lines changed
1 file changed +19
-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
+ // There currently doesn't seem to be a great way to do this in Windows and given
105
+ // that weak linkage is not really critical on Windows, we'll just leave it as a stub.
106
+ #define ET_WEAK
107
+ #else
103
108
#define ET_WEAK __attribute__((weak))
109
+ #endif
104
110
105
111
/**
106
112
* Annotation marking a function as printf-like, providing compiler support
107
113
* for format string argument checking.
108
114
*/
115
+ #ifdef _WIN32
116
+ #include <sal.h>
117
+ #define ET_PRINTFLIKE (_string_index , _va_index ) _Printf_format_string_
118
+ #else
109
119
#define ET_PRINTFLIKE (_string_index , _va_index ) \
110
120
__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)
121
+ #endif
114
122
115
123
#ifndef __has_builtin
116
124
#define __has_builtin (x ) (0)
117
125
#endif
118
126
127
+ #if __has_builtin (__builtin_strrchr )
128
+ /// Name of the source file without a directory string.
129
+ #define ET_SHORT_FILENAME (__builtin_strrchr("/" __FILE__, '/') + 1)
130
+ #else
131
+ #include <cstring>
132
+ #define ET_SHORT_FILENAME (strchr("/" __FILE__, '/') + 1)
133
+ #endif
134
+
119
135
#if __has_builtin (__builtin_LINE )
120
136
/// Current line as an integer.
121
137
#define ET_LINE __builtin_LINE()
You can’t perform that action at this time.
0 commit comments