[vlc-commits] Remove broken setting of WINAPI_FAMILY_APP

Rafaël Carré git at videolan.org
Mon Apr 22 07:54:59 CEST 2013


vlc | branch: master | Rafaël Carré <funman at videolan.org> | Mon Apr 22 07:47:28 2013 +0200| [2f1ba54e0ab9dca275645fab31b57eaa2f4a9a9b] | committer: Rafaël Carré

Remove broken setting of WINAPI_FAMILY_APP

The define to set would be WINAPI_FAMILY, and it is set by default already.
We should not set it though, as it would prevent us from using forbidden APIs (e.g. winsock).

Close #8410

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=2f1ba54e0ab9dca275645fab31b57eaa2f4a9a9b
---

 configure.ac            |    7 +++----
 modules/access/file.c   |    2 +-
 modules/lua/extension.c |    2 +-
 modules/lua/intf.c      |    2 +-
 modules/lua/libs/win.c  |    4 ++--
 src/config/help.c       |    6 +++---
 src/modules/bank.c      |    4 ++--
 src/text/unicode.c      |    2 +-
 src/win32/filesystem.c  |    2 +-
 src/win32/specific.c    |    6 +++---
 src/win32/thread.c      |    2 +-
 11 files changed, 19 insertions(+), 20 deletions(-)

diff --git a/configure.ac b/configure.ac
index 225e3a3..463a155 100644
--- a/configure.ac
+++ b/configure.ac
@@ -471,10 +471,9 @@ AC_ARG_ENABLE(winstore_app,
      AS_HELP_STRING([--enable-winstore-app],
                     [Build targetted for Windows Store apps (default disabled)]))
 
-AS_IF([test "${SYS}" = "mingw32"], [
-    AS_IF([test "${enable_winstore_app}" = "yes"], [
-       AC_DEFINE(WINAPI_FAMILY_APP, 1, [Define if you want to build for Windows Store apps])])
-    ])
+vlc_winstore_app=0
+AS_IF([test "${SYS}" = "mingw32" -a "${enable_winstore_app}" = "yes"], [vlc_winstore_app=1])
+AC_DEFINE_UNQUOTED(VLC_WINSTORE_APP, ${vlc_winstore_app}, [Define to 1 if you want to build for Windows Store apps])
 
 
 dnl
diff --git a/modules/access/file.c b/modules/access/file.c
index 97fa2af..a46a31b 100644
--- a/modules/access/file.c
+++ b/modules/access/file.c
@@ -112,7 +112,7 @@ static bool IsRemote (int fd)
 #else /* WIN32 || __OS2__ */
 static bool IsRemote (const char *path)
 {
-# if !defined(__OS2__) && !defined(WINAPI_FAMILY_APP)
+# if !defined(__OS2__) && !VLC_WINSTORE_APP
     wchar_t *wpath = ToWide (path);
     bool is_remote = (wpath != NULL && PathIsNetworkPathW (wpath));
     free (wpath);
diff --git a/modules/lua/extension.c b/modules/lua/extension.c
index 1ebccdc..9e91888 100644
--- a/modules/lua/extension.c
+++ b/modules/lua/extension.c
@@ -833,7 +833,7 @@ static lua_State* GetLuaState( extensions_manager_t *p_mgr,
             luaopen_vlm( L );
             luaopen_volume( L );
             luaopen_xml( L );
-#if defined(WIN32) && !defined(WINAPI_FAMILY_APP)
+#if defined(WIN32) && !VLC_WINSTORE_APP
             luaopen_win( L );
 #endif
 
diff --git a/modules/lua/intf.c b/modules/lua/intf.c
index e382647..96db69f 100644
--- a/modules/lua/intf.c
+++ b/modules/lua/intf.c
@@ -266,7 +266,7 @@ static int Start_LuaIntf( vlc_object_t *p_this, const char *name )
     luaopen_gettext( L );
     luaopen_xml( L );
     luaopen_equalizer( L );
-#if defined(WIN32) && !defined(WINAPI_FAMILY_APP)
+#if defined(WIN32) && !VLC_WINSTORE_APP
     luaopen_win( L );
 #endif
 
diff --git a/modules/lua/libs/win.c b/modules/lua/libs/win.c
index 49a01f8..c7c0ee6 100644
--- a/modules/lua/libs/win.c
+++ b/modules/lua/libs/win.c
@@ -33,7 +33,7 @@
 #include "../vlc.h"
 #include "../libs.h"
 
-#ifndef WINAPI_FAMILY_APP
+#if !VLC_WINSTORE_APP
 
 /* Based on modules/control/rc.c and include/vlc_interface.h */
 static HANDLE GetConsole( lua_State *L )
@@ -158,4 +158,4 @@ void luaopen_win( lua_State *L )
     lua_setfield( L, -2, "win" );
 }
 
-#endif /* WINAPI_FAMILY_APP */
+#endif /* !VLC_WINSTORE_APP */
diff --git a/src/config/help.c b/src/config/help.c
index d347cb8..5cb7b7b 100644
--- a/src/config/help.c
+++ b/src/config/help.c
@@ -34,7 +34,7 @@
 #include "config/configuration.h"
 #include "libvlc.h"
 
-#if defined( WIN32 ) && !defined(WINAPI_FAMILY_APP)
+#if defined( WIN32 ) && !VLC_WINSTORE_APP
 static void ShowConsole (void);
 static void PauseConsole (void);
 #else
@@ -796,7 +796,7 @@ static void Version( void )
     PauseConsole();
 }
 
-#if defined( WIN32 ) && !defined(WINAPI_FAMILY_APP)
+#if defined( WIN32 ) && !VLC_WINSTORE_APP
 /*****************************************************************************
  * ShowConsole: On Win32, create an output console for debug messages
  *****************************************************************************
@@ -862,7 +862,7 @@ static int ConsoleWidth( void )
             i_width = 80;
         pclose( file );
     }
-#elif !defined(WINAPI_FAMILY_APP)
+#elif !VLC_WINSTORE_APP
     CONSOLE_SCREEN_BUFFER_INFO buf;
 
     if (GetConsoleScreenBufferInfo (GetStdHandle (STD_OUTPUT_HANDLE), &buf))
diff --git a/src/modules/bank.c b/src/modules/bank.c
index 7b05b8d..22cfaea 100644
--- a/src/modules/bank.c
+++ b/src/modules/bank.c
@@ -317,7 +317,7 @@ static void AllocateAllPlugins (vlc_object_t *p_this)
     else
         mode = CACHE_USE;
 
-#ifdef WINAPI_FAMILY_APP
+#if VLC_WINSTORE_APP
     /* Windows Store Apps can not load external plugins with absolute paths. */
     AllocatePluginPath (p_this, "plugins", mode);
 #else
@@ -331,7 +331,7 @@ static void AllocateAllPlugins (vlc_object_t *p_this)
         free( paths );
     }
     free (vlcpath);
-#endif /* WINAPI_FAMILY_APP */
+#endif /* VLC_WINSTORE_APP */
 
     /* If the user provided a plugin path, we add it to the list */
     paths = getenv( "VLC_PLUGIN_PATH" );
diff --git a/src/text/unicode.c b/src/text/unicode.c
index 65a158d..d1de739 100644
--- a/src/text/unicode.c
+++ b/src/text/unicode.c
@@ -59,7 +59,7 @@ int utf8_vfprintf( FILE *stream, const char *fmt, va_list ap )
     if (unlikely(res == -1))
         return -1;
 
-#if !defined(WINAPI_FAMILY_APP)
+#if !VLC_WINSTORE_APP
     /* Writing to the console is a lot of fun on Microsoft Windows.
      * If you use the standard I/O functions, you must use the OEM code page,
      * which is different from the usual ANSI code page. Or maybe not, if the
diff --git a/src/win32/filesystem.c b/src/win32/filesystem.c
index 7758123..f20f7e4 100644
--- a/src/win32/filesystem.c
+++ b/src/win32/filesystem.c
@@ -240,7 +240,7 @@ int vlc_dup (int oldfd)
 
 int vlc_pipe (int fds[2])
 {
-#ifdef WINAPI_FAMILY_APP
+#if VLC_WINSTORE_APP
     _set_errno(EPERM);
     return -1;
 #else
diff --git a/src/win32/specific.c b/src/win32/specific.c
index ee1c56f..0058734 100644
--- a/src/win32/specific.c
+++ b/src/win32/specific.c
@@ -80,7 +80,7 @@ typedef struct
 
 void system_Configure( libvlc_int_t *p_this, int i_argc, const char *const ppsz_argv[] )
 {
-#if !defined(WINAPI_FAMILY_APP)
+#if !VLC_WINSTORE_APP
     /* Raise default priority of the current process */
 #ifndef ABOVE_NORMAL_PRIORITY_CLASS
 #   define ABOVE_NORMAL_PRIORITY_CLASS 0x00008000
@@ -210,7 +210,7 @@ void system_Configure( libvlc_int_t *p_this, int i_argc, const char *const ppsz_
 #endif
 }
 
-#if !defined(WINAPI_FAMILY_APP)
+#if !VLC_WINSTORE_APP
 static unsigned __stdcall IPCHelperThread( void *data )
 {
     vlc_object_t *p_this = data;
@@ -323,7 +323,7 @@ LRESULT CALLBACK WMCOPYWNDPROC( HWND hwnd, UINT uMsg, WPARAM wParam,
  */
 void system_End(void)
 {
-#if !defined(WINAPI_FAMILY_APP)
+#if !VLC_WINSTORE_APP
     HWND ipcwindow;
 
     /* FIXME: thread-safety... */
diff --git a/src/win32/thread.c b/src/win32/thread.c
index 589b10b..1744b08 100644
--- a/src/win32/thread.c
+++ b/src/win32/thread.c
@@ -680,7 +680,7 @@ static mtime_t mdate_wall (void)
     FILETIME ts;
     ULARGE_INTEGER s;
 
-#if (_WIN32_WINNT >= 0x0602) && !defined(WINAPI_FAMILY_APP)
+#if (_WIN32_WINNT >= 0x0602) && !VLC_WINSTORE_APP
     GetSystemTimePreciseAsFileTime (&ts);
 #else
     GetSystemTimeAsFileTime (&ts);



More information about the vlc-commits mailing list