File tree Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Expand file tree Collapse file tree 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change 100100#endif // (__cplusplus) >= 202002L
101101
102102/// Define a C symbol with weak linkage.
103+ #ifdef _WIN32
104+ #define ET_WEAK
105+ #else
103106#define ET_WEAK __attribute__((weak))
107+ #endif
104108
105109/**
106110 * Annotation marking a function as printf-like, providing compiler support
107111 * for format string argument checking.
108112 */
113+ #ifdef _MSC_VER
114+ #include <sal.h>
115+ #define ET_PRINTFLIKE (_string_index , _va_index ) _Printf_format_string_
116+ #else
109117#define ET_PRINTFLIKE (_string_index , _va_index ) \
110118 __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
114120
115121#ifndef __has_builtin
116122#define __has_builtin (x ) (0)
117123#endif
118124
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+
119133#if __has_builtin (__builtin_LINE )
120134/// Current line as an integer.
121135#define ET_LINE __builtin_LINE()
You can’t perform that action at this time.
0 commit comments