Skip to content

Commit aa4228e

Browse files
committed
Flip ordering of gcc/clang pragma checks
1 parent 442c565 commit aa4228e

2 files changed

Lines changed: 14 additions & 7 deletions

File tree

code/api/et/q_shared.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,14 @@ If you have questions concerning this license or the applicable additional terms
130130
#endif
131131

132132
#if defined(__GNUC__) || defined(__clang__)
133+
#ifdef __MINGW32__
134+
// For some reason MinGW wants both gnu_printf and ms_printf
135+
#define FORMAT_PRINTF(x, y) \
136+
__attribute__((format(gnu_printf, x, y))) \
137+
__attribute__((format(ms_printf, x, y)))
138+
#else
133139
#define FORMAT_PRINTF(x, y) __attribute__((format (printf, x, y)))
140+
#endif
134141
#else
135142
#define FORMAT_PRINTF(x, y) /* nothing */
136143
#endif

code/api/shared/q_endian.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,14 +45,14 @@ If you have questions concerning this license or the applicable additional terms
4545
============================================================================
4646
*/
4747

48-
#if defined (__GNUC)
49-
#pragma GCC diagnostic push
50-
#pragma GCC diagnostic ignored "-Wunused-function"
51-
#endif
5248
#if defined(__clang__)
5349
#pragma clang diagnostic push
5450
#pragma clang diagnostic ignored "-Wunused-function"
5551
#endif
52+
#if defined (__GNUC__)
53+
#pragma GCC diagnostic push
54+
#pragma GCC diagnostic ignored "-Wunused-function"
55+
#endif
5656

5757
void CopyShortSwap(void *dest, void *src)
5858
{
@@ -82,9 +82,9 @@ float FloatSwap(float f)
8282
return out.f;
8383
}
8484

85-
#if defined (__GNUC)
86-
#pragma GCC diagnostic pop
87-
#endif
8885
#if defined(__clang__)
8986
#pragma clang diagnostic pop
9087
#endif
88+
#if defined (__GNUC__)
89+
#pragma GCC diagnostic pop
90+
#endif

0 commit comments

Comments
 (0)