gl: fix usage of string.h and stdio.h functions without including the headers
authorMatthew Waters <matthew@centricular.com>
Tue, 20 Oct 2015 17:44:50 +0000 (04:44 +1100)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 9 Dec 2017 19:32:09 +0000 (19:32 +0000)
e.g:
gstglcontext_egl.c:613:7: error: implicit declaration of function 'strcmp'
[-Werror=implicit-function-declaration]
   if (strcmp (G_MODULE_SUFFIX, "so") == 0)

gst-libs/gst/gl/egl/gsteglimagememory.c
gst-libs/gst/gl/egl/gstglcontext_egl.c
gst-libs/gst/gl/gstglcolorconvert.c
gst-libs/gst/gl/gstglcontext.c

index eb45830..6e13a9f 100644 (file)
@@ -25,6 +25,7 @@
 #endif
 
 #include "gsteglimagememory.h"
+#include <string.h>
 
 GST_DEBUG_CATEGORY_STATIC (GST_CAT_EGL_IMAGE_MEMORY);
 #define GST_CAT_DEFAULT GST_CAT_EGL_IMAGE_MEMORY
index 5727636..2d3af18 100644 (file)
@@ -610,7 +610,7 @@ load_egl_module (gpointer user_data)
 #else
   /* On Linux the .so is only in -dev packages, try with a real soname
    * Proper compilers will optimize away the strcmp */
-  if (strcmp (G_MODULE_SUFFIX, "so") == 0)
+  if (g_strcmp0 (G_MODULE_SUFFIX, "so") == 0)
     module_egl = g_module_open ("libEGL.so.1", G_MODULE_BIND_LAZY);
 
   /* This automatically handles the suffix and even .la files */
index 1ab538f..b9e04a1 100644 (file)
@@ -22,6 +22,7 @@
 #include "config.h"
 #endif
 
+#include <string.h>
 #include <stdio.h>
 
 #include "gl.h"
index b4d5718..10cfe14 100644 (file)
@@ -41,6 +41,8 @@
 #endif
 
 #include <gmodule.h>
+#include <string.h>
+#include <stdio.h>
 
 #include "gl.h"
 #include "gstglcontext.h"
@@ -86,7 +88,7 @@ load_opengl_module (gpointer user_data)
 #else
   /* On Linux the .so is only in -dev packages, try with a real soname
    * Proper compilers will optimize away the strcmp */
-  if (strcmp (G_MODULE_SUFFIX, "so") == 0)
+  if (g_strcmp0 (G_MODULE_SUFFIX, "so") == 0)
     module_opengl = g_module_open ("libGL.so.1", G_MODULE_BIND_LAZY);
 
   /* This automatically handles the suffix and even .la files */
@@ -111,7 +113,7 @@ load_gles2_module (gpointer user_data)
 #else
   /* On Linux the .so is only in -dev packages, try with a real soname
    * Proper compilers will optimize away the strcmp */
-  if (strcmp (G_MODULE_SUFFIX, "so") == 0)
+  if (g_strcmp0 (G_MODULE_SUFFIX, "so") == 0)
     module_gles2 = g_module_open ("libGLESv2.so.2", G_MODULE_BIND_LAZY);
 
   /* This automatically handles the suffix and even .la files */