Commit 08fa8da77c3ef2f477d92b920dd3cb49faec0eeb

Sam Lantinga 2013-10-20T21:56:15

Fixed bug 2129 - fix for bug 2121 breaks linking for mingw and throws multiple warnings Andreas Ertelt The problem in question is caused by changeset 7771 (http://hg.libsdl.org/SDL/rev/5486e579872e / https://bugzilla.libsdl.org/show_bug.cgi?id=2121) The redefinition of __inline__ (introduced by the addition of begin_code.h:128's "|| __STRICT_ANSI__") results in mingw's gcc throwing multiple warning: always_inline function might not be inlinable [-Wattributes] as well as a whole bunch of redefinitions of mingw internals which break linking of projects including the SDL2 headers.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
diff --git a/include/begin_code.h b/include/begin_code.h
index 5261d26..3d43770 100644
--- a/include/begin_code.h
+++ b/include/begin_code.h
@@ -99,49 +99,36 @@
 #endif
 #endif /* Compiler needs structure packing set */
 
-#ifndef __inline__
+#ifndef SDL_INLINE
 /* Set up compiler-specific options for inlining functions */
-#ifndef SDL_INLINE_OKAY
-/* Add any special compiler-specific cases here */
 #if defined(_MSC_VER) || defined(__BORLANDC__) || \
     defined(__DMC__) || defined(__SC__) || \
     defined(__WATCOMC__) || defined(__LCC__) || \
     defined(__DECC)
-#ifndef __inline__
-#define __inline__  __inline
-#endif
-#define SDL_INLINE_OKAY 1
+#define SDL_INLINE  __inline
 #else
-#if !defined(__MRC__) && !defined(_SGI_SOURCE)
-#ifndef __inline__
-#define __inline__ inline
-#endif
-#define SDL_INLINE_OKAY 1
-#endif /* Not a funky compiler */
+#define SDL_INLINE inline
 #endif /* Visual C++ */
-#endif /* SDL_INLINE_OKAY */
+#endif /* SDL_INLINE not defined */
 
-/* If inlining isn't supported, remove "__inline__", turning static
-   inlined functions into static functions (resulting in code bloat
-   in all files which include the offending header files)
+/* If inlining isn't supported, remove SDL_INLINE, turning static
+   inlined functions into static functions (potentially resulting in
+   code bloat in all files which include the offending header files)
 */
-#if !SDL_INLINE_OKAY || __STRICT_ANSI__
-#ifdef __inline__
-#undef __inline__
+#if __STRICT_ANSI__
+#undef SDL_INLINE
+#define SDL_INLINE
 #endif
-#define __inline__
-#endif
-#endif /* __inline__ not defined */
 
 #ifndef SDL_FORCE_INLINE
 #if defined(_MSC_VER)
 #define SDL_FORCE_INLINE __forceinline
 #elif ( (defined(__GNUC__) && (__GNUC__ >= 4)) || defined(__clang__) )
-#define SDL_FORCE_INLINE __attribute__((always_inline)) static __inline__
+#define SDL_FORCE_INLINE __attribute__((always_inline)) static SDL_INLINE
 #else
-#define SDL_FORCE_INLINE static __inline__
-#endif
+#define SDL_FORCE_INLINE static SDL_INLINE
 #endif
+#endif /* SDL_FORCE_INLINE not defined */
 
 /* Apparently this is needed by several Windows compilers */
 #if !defined(__MACH__)
diff --git a/src/atomic/SDL_atomic.c b/src/atomic/SDL_atomic.c
index c747b12..e9b636f 100644
--- a/src/atomic/SDL_atomic.c
+++ b/src/atomic/SDL_atomic.c
@@ -55,7 +55,7 @@
 
 static SDL_SpinLock locks[32];
 
-static __inline__ void
+static SDL_INLINE void
 enterLock(void *a)
 {
     uintptr_t index = ((((uintptr_t)a) >> 3) & 0x1f);
@@ -63,7 +63,7 @@ enterLock(void *a)
     SDL_AtomicLock(&locks[index]);
 }
 
-static __inline__ void
+static SDL_INLINE void
 leaveLock(void *a)
 {
     uintptr_t index = ((((uintptr_t)a) >> 3) & 0x1f);
diff --git a/src/audio/SDL_audiodev.c b/src/audio/SDL_audiodev.c
index 91b60c3..af45a8b 100644
--- a/src/audio/SDL_audiodev.c
+++ b/src/audio/SDL_audiodev.c
@@ -46,7 +46,7 @@
 #define _PATH_DEV_AUDIO "/dev/audio"
 #endif
 
-static inline void
+static SDL_INLINE void
 test_device(const char *fname, int flags, int (*test) (int fd),
             SDL_AddAudioDevice addfn)
 {
diff --git a/src/audio/alsa/SDL_alsa_audio.c b/src/audio/alsa/SDL_alsa_audio.c
index 73bdcf2..5ff4cef 100644
--- a/src/audio/alsa/SDL_alsa_audio.c
+++ b/src/audio/alsa/SDL_alsa_audio.c
@@ -241,25 +241,25 @@ ALSA_WaitDevice(_THIS)
         tmp = ptr[3]; ptr[3] = ptr[5]; ptr[5] = tmp; \
     }
 
-static __inline__ void
+static SDL_INLINE void
 swizzle_alsa_channels_6_64bit(_THIS)
 {
     SWIZ6(Uint64);
 }
 
-static __inline__ void
+static SDL_INLINE void
 swizzle_alsa_channels_6_32bit(_THIS)
 {
     SWIZ6(Uint32);
 }
 
-static __inline__ void
+static SDL_INLINE void
 swizzle_alsa_channels_6_16bit(_THIS)
 {
     SWIZ6(Uint16);
 }
 
-static __inline__ void
+static SDL_INLINE void
 swizzle_alsa_channels_6_8bit(_THIS)
 {
     SWIZ6(Uint8);
@@ -272,7 +272,7 @@ swizzle_alsa_channels_6_8bit(_THIS)
  * Called right before feeding this->hidden->mixbuf to the hardware. Swizzle
  *  channels from Windows/Mac order to the format alsalib will want.
  */
-static __inline__ void
+static SDL_INLINE void
 swizzle_alsa_channels(_THIS)
 {
     if (this->spec.channels == 6) {
diff --git a/src/audio/pulseaudio/SDL_pulseaudio.c b/src/audio/pulseaudio/SDL_pulseaudio.c
index 7bf4acc..5923eae 100644
--- a/src/audio/pulseaudio/SDL_pulseaudio.c
+++ b/src/audio/pulseaudio/SDL_pulseaudio.c
@@ -49,7 +49,7 @@
 
 #if (PA_API_VERSION < 12)
 /** Return non-zero if the passed state is one of the connected states */
-static __inline__ int PA_CONTEXT_IS_GOOD(pa_context_state_t x) {
+static SDL_INLINE int PA_CONTEXT_IS_GOOD(pa_context_state_t x) {
     return
         x == PA_CONTEXT_CONNECTING ||
         x == PA_CONTEXT_AUTHORIZING ||
@@ -57,7 +57,7 @@ static __inline__ int PA_CONTEXT_IS_GOOD(pa_context_state_t x) {
         x == PA_CONTEXT_READY;
 }
 /** Return non-zero if the passed state is one of the connected states */
-static __inline__ int PA_STREAM_IS_GOOD(pa_stream_state_t x) {
+static SDL_INLINE int PA_STREAM_IS_GOOD(pa_stream_state_t x) {
     return
         x == PA_STREAM_CREATING ||
         x == PA_STREAM_READY;
@@ -322,7 +322,7 @@ PULSEAUDIO_CloseDevice(_THIS)
 }
 
 
-static __inline__ int
+static SDL_INLINE int
 squashVersion(const int major, const int minor, const int patch)
 {
     return ((major & 0xFF) << 16) | ((minor & 0xFF) << 8) | (patch & 0xFF);
diff --git a/src/audio/qsa/SDL_qsa_audio.c b/src/audio/qsa/SDL_qsa_audio.c
index a5286d8..78f69c0 100644
--- a/src/audio/qsa/SDL_qsa_audio.c
+++ b/src/audio/qsa/SDL_qsa_audio.c
@@ -83,7 +83,7 @@ uint32_t qsa_playback_devices;
 QSA_Device qsa_capture_device[QSA_MAX_DEVICES];
 uint32_t qsa_capture_devices;
 
-static inline int
+static SDL_INLINE int
 QSA_SetError(const char *fn, int status)
 {
     return SDL_SetError("QSA: %s() failed: %s", fn, snd_strerror(status));
diff --git a/src/cpuinfo/SDL_cpuinfo.c b/src/cpuinfo/SDL_cpuinfo.c
index 2b81f91..f9b7640 100644
--- a/src/cpuinfo/SDL_cpuinfo.c
+++ b/src/cpuinfo/SDL_cpuinfo.c
@@ -68,7 +68,7 @@ illegal_instruction(int sig)
 }
 #endif /* HAVE_SETJMP */
 
-static __inline__ int
+static SDL_INLINE int
 CPU_haveCPUID(void)
 {
     int has_CPUID = 0;
@@ -192,7 +192,7 @@ done:
     a = b = c = d = 0
 #endif
 
-static __inline__ int
+static SDL_INLINE int
 CPU_getCPUIDFeatures(void)
 {
     int features = 0;
@@ -206,7 +206,7 @@ CPU_getCPUIDFeatures(void)
     return features;
 }
 
-static __inline__ int
+static SDL_INLINE int
 CPU_haveRDTSC(void)
 {
     if (CPU_haveCPUID()) {
@@ -215,7 +215,7 @@ CPU_haveRDTSC(void)
     return 0;
 }
 
-static __inline__ int
+static SDL_INLINE int
 CPU_haveAltiVec(void)
 {
     volatile int altivec = 0;
@@ -242,7 +242,7 @@ CPU_haveAltiVec(void)
     return altivec;
 }
 
-static __inline__ int
+static SDL_INLINE int
 CPU_haveMMX(void)
 {
     if (CPU_haveCPUID()) {
@@ -251,7 +251,7 @@ CPU_haveMMX(void)
     return 0;
 }
 
-static __inline__ int
+static SDL_INLINE int
 CPU_have3DNow(void)
 {
     if (CPU_haveCPUID()) {
@@ -266,7 +266,7 @@ CPU_have3DNow(void)
     return 0;
 }
 
-static __inline__ int
+static SDL_INLINE int
 CPU_haveSSE(void)
 {
     if (CPU_haveCPUID()) {
@@ -275,7 +275,7 @@ CPU_haveSSE(void)
     return 0;
 }
 
-static __inline__ int
+static SDL_INLINE int
 CPU_haveSSE2(void)
 {
     if (CPU_haveCPUID()) {
@@ -284,7 +284,7 @@ CPU_haveSSE2(void)
     return 0;
 }
 
-static __inline__ int
+static SDL_INLINE int
 CPU_haveSSE3(void)
 {
     if (CPU_haveCPUID()) {
@@ -299,7 +299,7 @@ CPU_haveSSE3(void)
     return 0;
 }
 
-static __inline__ int
+static SDL_INLINE int
 CPU_haveSSE41(void)
 {
     if (CPU_haveCPUID()) {
@@ -314,7 +314,7 @@ CPU_haveSSE41(void)
     return 0;
 }
 
-static __inline__ int
+static SDL_INLINE int
 CPU_haveSSE42(void)
 {
     if (CPU_haveCPUID()) {
diff --git a/src/events/SDL_events.c b/src/events/SDL_events.c
index 53ba23f..9984503 100644
--- a/src/events/SDL_events.c
+++ b/src/events/SDL_events.c
@@ -83,7 +83,7 @@ static struct
 } SDL_EventQ = { NULL, SDL_TRUE };
 
 
-static __inline__ SDL_bool
+static SDL_INLINE SDL_bool
 SDL_ShouldPollJoystick()
 {
 #if !SDL_JOYSTICK_DISABLED
diff --git a/src/joystick/linux/SDL_sysjoystick.c b/src/joystick/linux/SDL_sysjoystick.c
index 23a5a4c..72fa52c 100644
--- a/src/joystick/linux/SDL_sysjoystick.c
+++ b/src/joystick/linux/SDL_sysjoystick.c
@@ -617,7 +617,7 @@ SDL_bool SDL_SYS_JoystickAttached(SDL_Joystick *joystick)
     return !joystick->closed && (joystick->hwdata->item != NULL);
 }
 
-static __inline__ void
+static SDL_INLINE void
 HandleHat(SDL_Joystick * stick, Uint8 hat, int axis, int value)
 {
     struct hwdata_hat *the_hat;
@@ -643,14 +643,14 @@ HandleHat(SDL_Joystick * stick, Uint8 hat, int axis, int value)
     }
 }
 
-static __inline__ void
+static SDL_INLINE void
 HandleBall(SDL_Joystick * stick, Uint8 ball, int axis, int value)
 {
     stick->hwdata->balls[ball].axis[axis] += value;
 }
 
 
-static __inline__ int
+static SDL_INLINE int
 AxisCorrect(SDL_Joystick * joystick, int which, int value)
 {
     struct axis_correct *correct;
@@ -679,7 +679,7 @@ AxisCorrect(SDL_Joystick * joystick, int which, int value)
     return value;
 }
 
-static __inline__ void
+static SDL_INLINE void
 PollAllValues(SDL_Joystick * joystick)
 {
     struct input_absinfo absinfo;
@@ -717,7 +717,7 @@ PollAllValues(SDL_Joystick * joystick)
     }
 }
 
-static __inline__ void
+static SDL_INLINE void
 HandleInputEvents(SDL_Joystick * joystick)
 {
     struct input_event events[32];
diff --git a/src/joystick/psp/SDL_sysjoystick.c b/src/joystick/psp/SDL_sysjoystick.c
index d6ca698..b953372 100644
--- a/src/joystick/psp/SDL_sysjoystick.c
+++ b/src/joystick/psp/SDL_sysjoystick.c
@@ -60,7 +60,7 @@ static point c = { 78, 32767 };
 static point d = { 128, 32767 };
 
 /* simple linear interpolation between two points */
-static __inline__ void lerp (point *dest, point *a, point *b, float t)
+static SDL_INLINE void lerp (point *dest, point *a, point *b, float t)
 {
     dest->x = a->x + (b->x - a->x)*t;
     dest->y = a->y + (b->y - a->y)*t;
diff --git a/src/render/opengles/SDL_render_gles.c b/src/render/opengles/SDL_render_gles.c
index b3ce790..3be1998 100644
--- a/src/render/opengles/SDL_render_gles.c
+++ b/src/render/opengles/SDL_render_gles.c
@@ -414,7 +414,7 @@ GLES_WindowEvent(SDL_Renderer * renderer, const SDL_WindowEvent *event)
     }
 }
 
-static __inline__ int
+static SDL_INLINE int
 power_of_2(int input)
 {
     int value = 1;
diff --git a/src/video/SDL_blit_copy.c b/src/video/SDL_blit_copy.c
index 6d286c3..80519e0 100644
--- a/src/video/SDL_blit_copy.c
+++ b/src/video/SDL_blit_copy.c
@@ -27,7 +27,7 @@
 
 #ifdef __SSE__
 /* This assumes 16-byte aligned src and dst */
-static __inline__ void
+static SDL_INLINE void
 SDL_memcpySSE(Uint8 * dst, const Uint8 * src, int len)
 {
     int i;
@@ -56,7 +56,7 @@ SDL_memcpySSE(Uint8 * dst, const Uint8 * src, int len)
 #ifdef _MSC_VER
 #pragma warning(disable:4799)
 #endif
-static __inline__ void
+static SDL_INLINE void
 SDL_memcpyMMX(Uint8 * dst, const Uint8 * src, int len)
 {
     const int remain = (len & 63);
diff --git a/src/video/SDL_surface.c b/src/video/SDL_surface.c
index 8418bc3..d4c852a 100644
--- a/src/video/SDL_surface.c
+++ b/src/video/SDL_surface.c
@@ -951,7 +951,7 @@ SDL_ConvertSurfaceFormat(SDL_Surface * surface, Uint32 pixel_format,
 /*
  * Create a surface on the stack for quick blit operations
  */
-static __inline__ SDL_bool
+static SDL_INLINE SDL_bool
 SDL_CreateSurfaceOnStack(int width, int height, Uint32 pixel_format,
                          void * pixels, int pitch, SDL_Surface * surface,
                          SDL_PixelFormat * format, SDL_BlitMap * blitmap)
diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c
index a2078a7..201ba53 100644
--- a/src/video/SDL_video.c
+++ b/src/video/SDL_video.c
@@ -2382,7 +2382,7 @@ SDL_GL_UnloadLibrary(void)
     }
 }
 
-static __inline__ SDL_bool
+static SDL_INLINE SDL_bool
 isAtLeastGL3(const char *verstr)
 {
     return ( verstr && (SDL_atoi(verstr) >= 3) );
diff --git a/src/video/bwindow/SDL_bframebuffer.cc b/src/video/bwindow/SDL_bframebuffer.cc
index 6e7f8c3..69f4a43 100644
--- a/src/video/bwindow/SDL_bframebuffer.cc
+++ b/src/video/bwindow/SDL_bframebuffer.cc
@@ -37,11 +37,11 @@ extern "C" {
 
 int32 BE_UpdateOnce(SDL_Window *window);
 
-static inline SDL_BWin *_ToBeWin(SDL_Window *window) {
+static SDL_INLINE SDL_BWin *_ToBeWin(SDL_Window *window) {
 	return ((SDL_BWin*)(window->driverdata));
 }
 
-static inline SDL_BApp *_GetBeApp() {
+static SDL_INLINE SDL_BApp *_GetBeApp() {
 	return ((SDL_BApp*)be_app);
 }
 
diff --git a/src/video/bwindow/SDL_bmodes.cc b/src/video/bwindow/SDL_bmodes.cc
index 41894fb..44e19dc 100644
--- a/src/video/bwindow/SDL_bmodes.cc
+++ b/src/video/bwindow/SDL_bmodes.cc
@@ -48,15 +48,15 @@ typedef struct SDL_DisplayModeData {
 };
 #endif
 
-static inline SDL_BWin *_ToBeWin(SDL_Window *window) {
+static SDL_INLINE SDL_BWin *_ToBeWin(SDL_Window *window) {
 	return ((SDL_BWin*)(window->driverdata));
 }
 
-static inline SDL_BApp *_GetBeApp() {
+static SDL_INLINE SDL_BApp *_GetBeApp() {
 	return ((SDL_BApp*)be_app);
 }
 
-static inline display_mode * _ExtractBMode(SDL_DisplayMode *mode) {
+static SDL_INLINE display_mode * _ExtractBMode(SDL_DisplayMode *mode) {
 #if WRAP_BMODE
 	return ((SDL_DisplayModeData*)mode->driverdata)->bmode;
 #else
diff --git a/src/video/bwindow/SDL_bopengl.cc b/src/video/bwindow/SDL_bopengl.cc
index 5acefe2..13b90ad 100644
--- a/src/video/bwindow/SDL_bopengl.cc
+++ b/src/video/bwindow/SDL_bopengl.cc
@@ -37,11 +37,11 @@ extern "C" {
 
 #define BGL_FLAGS BGL_RGB | BGL_DOUBLE
 
-static inline SDL_BWin *_ToBeWin(SDL_Window *window) {
+static SDL_INLINE SDL_BWin *_ToBeWin(SDL_Window *window) {
 	return ((SDL_BWin*)(window->driverdata));
 }
 
-static inline SDL_BApp *_GetBeApp() {
+static SDL_INLINE SDL_BApp *_GetBeApp() {
 	return ((SDL_BApp*)be_app);
 }
 
diff --git a/src/video/bwindow/SDL_bwindow.cc b/src/video/bwindow/SDL_bwindow.cc
index c6eb3aa..c898be6 100644
--- a/src/video/bwindow/SDL_bwindow.cc
+++ b/src/video/bwindow/SDL_bwindow.cc
@@ -31,11 +31,11 @@
 extern "C" {
 #endif
 
-static inline SDL_BWin *_ToBeWin(SDL_Window *window) {
+static SDL_INLINE SDL_BWin *_ToBeWin(SDL_Window *window) {
 	return ((SDL_BWin*)(window->driverdata));
 }
 
-static inline SDL_BApp *_GetBeApp() {
+static SDL_INLINE SDL_BApp *_GetBeApp() {
 	return ((SDL_BApp*)be_app);
 }
 
diff --git a/src/video/directfb/SDL_DirectFB_render.c b/src/video/directfb/SDL_DirectFB_render.c
index 3e8ba47..219f520 100644
--- a/src/video/directfb/SDL_DirectFB_render.c
+++ b/src/video/directfb/SDL_DirectFB_render.c
@@ -167,7 +167,7 @@ typedef struct
 #endif
 } DirectFB_TextureData;
 
-static __inline__ void
+static SDL_INLINE void
 SDLtoDFBRect(const SDL_Rect * sr, DFBRectangle * dr)
 {
     dr->x = sr->x;
@@ -175,7 +175,7 @@ SDLtoDFBRect(const SDL_Rect * sr, DFBRectangle * dr)
     dr->h = sr->h;
     dr->w = sr->w;
 }
-static __inline__ void
+static SDL_INLINE void
 SDLtoDFBRect_Float(const SDL_FRect * sr, DFBRectangle * dr)
 {
     dr->x = sr->x;
@@ -211,7 +211,7 @@ TextureHasAlpha(DirectFB_TextureData * data)
 #endif
 }
 
-static inline IDirectFBSurface *get_dfb_surface(SDL_Window *window)
+static SDL_INLINE IDirectFBSurface *get_dfb_surface(SDL_Window *window)
 {
     SDL_SysWMinfo wm_info;
     SDL_memset(&wm_info, 0, sizeof(SDL_SysWMinfo));
@@ -222,7 +222,7 @@ static inline IDirectFBSurface *get_dfb_surface(SDL_Window *window)
     return wm_info.info.dfb.surface;
 }
 
-static inline IDirectFBWindow *get_dfb_window(SDL_Window *window)
+static SDL_INLINE IDirectFBWindow *get_dfb_window(SDL_Window *window)
 {
     SDL_SysWMinfo wm_info;
     SDL_memset(&wm_info, 0, sizeof(SDL_SysWMinfo));
diff --git a/src/video/directfb/SDL_DirectFB_video.h b/src/video/directfb/SDL_DirectFB_video.h
index c3630fd..b40bac0 100644
--- a/src/video/directfb/SDL_DirectFB_video.h
+++ b/src/video/directfb/SDL_DirectFB_video.h
@@ -88,7 +88,7 @@
 
 #define SDL_DFB_DEBUG(x...) SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, x)
 
-static inline DFBResult sdl_dfb_check(DFBResult ret, const char *src_file, int src_line) {
+static SDL_INLINE DFBResult sdl_dfb_check(DFBResult ret, const char *src_file, int src_line) {
     if (ret != DFB_OK) {
         SDL_DFB_LOG("%s (%d):%s", src_file, src_line, DirectFBErrorString (ret) );
         SDL_SetError("%s:%s", SDL_DFB_CONTEXT, DirectFBErrorString (ret) );
diff --git a/src/video/x11/SDL_x11messagebox.c b/src/video/x11/SDL_x11messagebox.c
index 0d0ffb7..81c1480 100644
--- a/src/video/x11/SDL_x11messagebox.c
+++ b/src/video/x11/SDL_x11messagebox.c
@@ -112,7 +112,7 @@ typedef struct SDL_MessageBoxDataX11
 } SDL_MessageBoxDataX11;
 
 /* Maximum helper for ints. */
-static __inline__ int
+static SDL_INLINE int
 IntMax( int a, int b )
 {
     return ( a > b  ) ? a : b;