@@ -340,7 +340,7 @@ NP_DECL(int) np_ftrylockfile(void *e);
340
340
341
341
#if !defined(NUITKAPYTHON_EMBED_BUILD ) && !defined(NP_STDIO_ALREADY_LOADED )
342
342
343
- #ifdef __GNUC__
343
+ #if defined( __GNUC__ ) && !defined( __llvm__ ) && !defined( __INTEL_COMPILER )
344
344
#define CAT (a , ...) PRIMITIVE_CAT(a, __VA_ARGS__)
345
345
#define PRIMITIVE_CAT (a , ...) a ## __VA_ARGS__
346
346
@@ -422,7 +422,7 @@ NP_DECL(int) np_ftrylockfile(void *e);
422
422
#define NUM_ARGS1 (_20 ,_19 ,_18 ,_17 ,_16 ,_15 ,_14 ,_13 ,_12 ,_11 ,_10 ,_9 ,_8 ,_7 ,_6 ,_5 ,_4 ,_3 ,_2 ,_1 , n , ...) n
423
423
#define NUM_ARGS0 (...) NUM_ARGS1(__VA_ARGS__,20,19,18,17,16,15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0)
424
424
#define NUM_ARGS (...) IF(DEC(NUM_ARGS0(__VA_ARGS__)))(NUM_ARGS0(__VA_ARGS__),IF(IS_PAREN(__VA_ARGS__ ()))(0,1))
425
- #endif // __GNUC__
425
+ #endif // GCC only
426
426
427
427
// Preprocessor Translation
428
428
#define FILE EFILE
@@ -442,7 +442,7 @@ ALWAYS_INLINE NP_DECL(EFILE*) _fopen(const char* file, const char* mode) {
442
442
return np_fopen (file , mode );
443
443
}
444
444
445
- #ifdef __GNUC__
445
+ #if defined( __GNUC__ ) && !defined( __llvm__ ) && !defined( __INTEL_COMPILER )
446
446
#ifdef __cplusplus
447
447
ALWAYS_INLINE NP_DECL (int ) open (const char * pathname , int flags , mode_t mode = 0 ) {
448
448
#else
@@ -471,7 +471,7 @@ ALWAYS_INLINE NP_DECL(int) _open(const char *pathname, int flags, mode_t mode) {
471
471
#define open (...) CAT( open, NUM_ARGS( __VA_ARGS__ ) )( __VA_ARGS__ )
472
472
#define _open (...) CAT( open, NUM_ARGS( __VA_ARGS__ ) )( __VA_ARGS__ )
473
473
#endif // !__cplusplus
474
- #else // __GNUC__
474
+ #else // GCC only
475
475
ALWAYS_INLINE NP_DECL (int ) open (const char * pathname , int flags , ... /* mode_t mode */ ) {
476
476
va_list args ;
477
477
va_start (args , flags );
@@ -500,7 +500,7 @@ ALWAYS_INLINE NP_DECL(int) _open(const char *pathname, int flags, ... /* mode_t
500
500
va_end (args );
501
501
return np_open (pathname , flags , mode );
502
502
}
503
- #endif // !__GNUC__
503
+ #endif // !GCC
504
504
505
505
ALWAYS_INLINE NP_DECL (EFILE * ) fdopen (int fd , const char * mode ) {
506
506
return np_fdopen (fd , mode );
0 commit comments