Skip to contentSkip to conversation

backends/baum.c: Fix compilation when SDL is not available.

PATCH In review Richard W.M. Jones 3 participants 3 messages Mar 21, 2014 – Mar 24, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 backends/baum.c: Fix compilation when SDL is not available.

backends/baum.c: In function ‘chr_baum_init’:
backends/baum.c:569:64: error: missing binary operator before token "("

 #if defined(CONFIG_SDL) && SDL_COMPILEDVERSION < SDL_VERSIONNUM(2, 0, 0)
                                                                ^

backends/baum.c:598:64: error: missing binary operator before token "("
#if defined(CONFIG_SDL) && SDL_COMPILEDVERSION < SDL_VERSIONNUM(2, 0, 0)

---
 backends/baum.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
backends/baum.c +6 -2
index 665107f..759003f 100644
@@ -566,9 +566,11 @@ CharDriverState *chr_baum_init(void)
     BaumDriverState *baum;
     CharDriverState *chr;
     brlapi_handle_t *handle;
-#if defined(CONFIG_SDL) && SDL_COMPILEDVERSION < SDL_VERSIONNUM(2, 0, 0)
+#if defined(CONFIG_SDL)
+#if SDL_COMPILEDVERSION < SDL_VERSIONNUM(2, 0, 0)
     SDL_SysWMinfo info;
 #endif
+#endif
     int tty;
 
     baum = g_malloc0(sizeof(BaumDriverState));
@@ -595,13 +597,15 @@ CharDriverState *chr_baum_init(void)
         goto fail;
     }
 
-#if defined(CONFIG_SDL) && SDL_COMPILEDVERSION < SDL_VERSIONNUM(2, 0, 0)
+#if defined(CONFIG_SDL)
+#if SDL_COMPILEDVERSION < SDL_VERSIONNUM(2, 0, 0)
     memset(&info, 0, sizeof(info));
     SDL_VERSION(&info.version);
     if (SDL_GetWMInfo(&info))
         tty = info.info.x11.wmwindow;
     else
 #endif
+#endif
         tty = BRLAPI_TTY_DEFAULT;
 
     if (brlapi__enterTtyMode(handle, tty, NULL) == -1) {
Signature · 1 line
1.8.5.3
Reviewed-by on v1 1/1
#1 lore raw

Am 21.03.2014 22:29, schrieb Richard W.M. Jones:

Quoted 37 lines

backends/baum.c: In function ‘chr_baum_init’:
backends/baum.c:569:64: error: missing binary operator before token "("

 #if defined(CONFIG_SDL) && SDL_COMPILEDVERSION < SDL_VERSIONNUM(2, 0, 0)
                                                                ^

backends/baum.c:598:64: error: missing binary operator before token "("
#if defined(CONFIG_SDL) && SDL_COMPILEDVERSION < SDL_VERSIONNUM(2, 0, 0)

---
 backends/baum.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
backends/baum.c +5 -2
index 665107f..759003f 100644
@@ -566,9 +566,11 @@ CharDriverState *chr_baum_init(void)
     BaumDriverState *baum;
     CharDriverState *chr;
     brlapi_handle_t *handle;
-#if defined(CONFIG_SDL) && SDL_COMPILEDVERSION < SDL_VERSIONNUM(2, 0, 0)
+#if defined(CONFIG_SDL)
+#if SDL_COMPILEDVERSION < SDL_VERSIONNUM(2, 0, 0)
     SDL_SysWMinfo info;
 #endif
+#endif
     int tty;
 
     baum = g_malloc0(sizeof(BaumDriverState));
@@ -595,13 +597,15 @@ CharDriverState *chr_baum_init(void)
         goto fail;
     }
 
-#if defined(CONFIG_SDL) && SDL_COMPILEDVERSION < SDL_VERSIONNUM(2, 0, 0)
+#if defined(CONFIG_SDL)
+#if SDL_COMPILEDVERSION < SDL_VERSIONNUM(2, 0, 0)

backends/baum.c CharDriverState *chr_baum_init(void) · line 611

Quoted 10 lines
backends/baum.c +1 -0
     memset(&info, 0, sizeof(info));
     SDL_VERSION(&info.version);
     if (SDL_GetWMInfo(&info))
         tty = info.info.x11.wmwindow;
     else
 #endif
+#endif
         tty = BRLAPI_TTY_DEFAULT;
 
     if (brlapi__enterTtyMode(handle, tty, NULL) == -1) {
#2 lore raw
In reply to Richard W.M. Jones
Quoted 8 lines · Richard W.M. Jones

backends/baum.c: In function ‘chr_baum_init’:
backends/baum.c:569:64: error: missing binary operator before token "("

 #if defined(CONFIG_SDL) && SDL_COMPILEDVERSION < SDL_VERSIONNUM(2, 0, 0)
                                                                ^

backends/baum.c:598:64: error: missing binary operator before token "("
#if defined(CONFIG_SDL) && SDL_COMPILEDVERSION < SDL_VERSIONNUM(2, 0, 0)

Applied to master as a buildfix.

thanks
-- PMM