Skip to content

Commit 5f90be0

Browse files
committed
Use more complete GCC detection.
1 parent 7368abb commit 5f90be0

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Include/np_embed.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ NP_DECL(int) np_ftrylockfile(void *e);
340340

341341
#if !defined(NUITKAPYTHON_EMBED_BUILD) && !defined(NP_STDIO_ALREADY_LOADED)
342342

343-
#ifdef __GNUC__
343+
#if defined(__GNUC__) && !defined(__llvm__) && !defined(__INTEL_COMPILER)
344344
#define CAT(a, ...) PRIMITIVE_CAT(a, __VA_ARGS__)
345345
#define PRIMITIVE_CAT(a, ...) a ## __VA_ARGS__
346346

@@ -422,7 +422,7 @@ NP_DECL(int) np_ftrylockfile(void *e);
422422
#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
423423
#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)
424424
#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
426426

427427
// Preprocessor Translation
428428
#define FILE EFILE
@@ -442,7 +442,7 @@ ALWAYS_INLINE NP_DECL(EFILE*) _fopen(const char* file, const char* mode) {
442442
return np_fopen(file, mode);
443443
}
444444

445-
#ifdef __GNUC__
445+
#if defined(__GNUC__) && !defined(__llvm__) && !defined(__INTEL_COMPILER)
446446
#ifdef __cplusplus
447447
ALWAYS_INLINE NP_DECL(int) open(const char *pathname, int flags, mode_t mode = 0) {
448448
#else
@@ -471,7 +471,7 @@ ALWAYS_INLINE NP_DECL(int) _open(const char *pathname, int flags, mode_t mode) {
471471
#define open(...) CAT( open, NUM_ARGS( __VA_ARGS__ ) )( __VA_ARGS__ )
472472
#define _open(...) CAT( open, NUM_ARGS( __VA_ARGS__ ) )( __VA_ARGS__ )
473473
#endif // !__cplusplus
474-
#else // __GNUC__
474+
#else // GCC only
475475
ALWAYS_INLINE NP_DECL(int) open(const char *pathname, int flags, ... /* mode_t mode */ ) {
476476
va_list args;
477477
va_start(args, flags);
@@ -500,7 +500,7 @@ ALWAYS_INLINE NP_DECL(int) _open(const char *pathname, int flags, ... /* mode_t
500500
va_end(args);
501501
return np_open(pathname, flags, mode);
502502
}
503-
#endif // !__GNUC__
503+
#endif // !GCC
504504

505505
ALWAYS_INLINE NP_DECL(EFILE*) fdopen(int fd, const char *mode) {
506506
return np_fdopen(fd, mode);

0 commit comments

Comments
 (0)