* configure.ac.in, modules/gui/wxwindows/wxwindows.cpp: other compilation
authorGildas Bazin <gbazin@videolan.org>
Wed, 20 Nov 2002 15:58:15 +0000 (15:58 +0000)
committerGildas Bazin <gbazin@videolan.org>
Wed, 20 Nov 2002 15:58:15 +0000 (15:58 +0000)
   fixes for the wxwindows interface on win32.

configure.ac.in
modules/gui/wxwindows/wxwindows.cpp

index fa2d75f..b2f3131 100644 (file)
@@ -125,8 +125,6 @@ case "x${target_os}" in
         # add ws2_32 for closesocket, select, recv
         CPPFLAGS_save="${CPPFLAGS_save} -D_OFF_T_ -D_off_t=long"
         CPPFLAGS="${CPPFLAGS_save}"
-        CXXFLAGS_save="${CXXFLAGS_save} -fvtable-thunks";
-        CXXFLAGS="${CXXFLAGS_save}"
         LDFLAGS_vlc="${LDFLAGS_vlc} -lws2_32 -lnetapi32 -mwindows"
         LDFLAGS_ipv4="${LDFLAGS_ipv4} -lws2_32"
         LDFLAGS_ipv6="${LDFLAGS_ipv6} -lws2_32"
@@ -192,17 +190,37 @@ then
         CFLAGS_mingw32_special="-fnative-struct"
     fi
 
-    CFLAGS_save="${CFLAGS_save} ${CFLAGS_mingw32_special}"; CFLAGS="${CFLAGS_save}"
+    CFLAGS_save="${CFLAGS_save} ${CFLAGS_mingw32_special}";
+    CXXFLAGS_save="${CXXFLAGS_save} ${CFLAGS_mingw32_special}";
+    CFLAGS="${CFLAGS_save}"; CXXFLAGS="${CXXFLAGS_save}"
+fi
+
+dnl Check for fvtable-thunks support for mingw32
+if test x$SYS = xmingw32
+then
+AC_LANG_PUSH(C++)
+    AC_CACHE_CHECK([if \$CXX accepts -fvtable-thunks],
+        [ac_cv_cxx_fvtable_thunks],
+        [CXXFLAGS="${CXXFLAGS_save} -Wall -Werror -fvtable-thunks"
+         AC_TRY_COMPILE([],,ac_cv_cxx_fvtable_thunks=yes,
+                        ac_cv_cxx_fvtable_thunks=no)])
+    if test x"$ac_cv_cxx_fvtable_thunks" = x"yes"; then
+        CXXFLAGS_mingw32_special="-fvtable-thunks"
+    fi
+
+    CXXFLAGS_save="${CXXFLAGS_save} ${CXXFLAGS_mingw32_special}"
+    CXXFLAGS="${CXXFLAGS_save}"
+AC_LANG_POP(C++)
 fi
 
 dnl Flags for plugin compilation
 case "x${SYS}" in
   xmingw32|xcygwin)
     CFLAGS_pics="${CFLAGS_pics} ${CFLAGS_mingw32_special}"
-    CXXFLAGS_pics="${CXXFLAGS_pics} ${CFLAGS_mingw32_special}"
+    CXXFLAGS_pics="${CXXFLAGS_pics} ${CFLAGS_mingw32_special} ${CXXFLAGS_mingw32_special}"
     OBJCFLAGS_pics="${OBJCFLAGS_pics} ${CFLAGS_mingw32_special}"
     CFLAGS_plugins="${CFLAGS_plugins} ${CFLAGS_mingw32_special}"
-    CXXFLAGS_plugins="${CXXFLAGS_plugins} ${CFLAGS_mingw32_special}"
+    CXXFLAGS_plugins="${CXXFLAGS_plugins} ${CFLAGS_mingw32_special} ${CXXFLAGS_mingw32_special}"
     OBJCFLAGS_plugins="${OBJCFLAGS_plugins} ${CFLAGS_mingw32_special}"
     ;;
   x*)
@@ -2482,7 +2500,9 @@ AC_SUBST(LDFLAGS)
 
 AC_SUBST(CFLAGS_vlc)
 AC_SUBST(CFLAGS_pics)
+AC_SUBST(CXXFLAGS_pics)
 AC_SUBST(CFLAGS_plugins)
+AC_SUBST(CXXFLAGS_plugins)
 AC_SUBST(CFLAGS_builtins)
 AC_SUBST(CPPFLAGS_mozilla)
 
index 91fdfc1..ec94bc8 100644 (file)
@@ -2,7 +2,7 @@
  * wxwindows.cpp : wxWindows plugin for vlc
  *****************************************************************************
  * Copyright (C) 2000-2001 VideoLAN
- * $Id: wxwindows.cpp,v 1.2 2002/11/20 14:24:00 gbazin Exp $
+ * $Id: wxwindows.cpp,v 1.3 2002/11/20 15:58:15 gbazin Exp $
  *
  * Authors: Gildas Bazin <gbazin@netcourrier.com>
  *
@@ -36,8 +36,8 @@
 #undef _
 
 #ifdef WIN32                                                 /* mingw32 hack */
-#undef Yield()
-#undef CreateDialog()
+#undef Yield
+#undef CreateDialog
 #endif
 
 #include <wx/wxprec.h>