From 32e785f81320342058bbee95f84095cd55449c09 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Wed, 2 Sep 2015 14:35:37 -0700 Subject: The official #define for 32-bit and 64-bit Windows is _WIN32. It's _WIN32, with a leading underscore, not WIN32. See, for example: https://sourceforge.net/p/predef/wiki/OperatingSystems/ and https://msdn.microsoft.com/en-us/library/b0084kay.aspx *Some* environments may also define WIN32, but we shouldn't depend on that. Replace all-caps "WIN32" referring to Windows in comments and other text with "Windows" or "Win32". (The two are pretty much equivalent, these days; nobody much cares about Win16, not that we ever ran on it, and 64-bit Windows is just a 64-bitified Win32.) Change-Id: Id327bcd4b1e9baa4f27055eff08c2d9e594d6f70 Reviewed-on: https://code.wireshark.org/review/10367 Petri-Dish: Guy Harris Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris --- extcap.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'extcap.c') diff --git a/extcap.c b/extcap.c index 339021971b..92c3323461 100644 --- a/extcap.c +++ b/extcap.c @@ -28,7 +28,7 @@ #include #include -#ifdef WIN32 +#ifdef _WIN32 #include #include #include @@ -139,7 +139,7 @@ static void extcap_foreach(gint argc, gchar **args, extcap_cb_t cb, const gchar *file; gboolean keep_going; gchar **argv; -#ifdef WIN32 +#ifdef _WIN32 gchar **dll_search_envp; gchar *progfile_dir; #endif @@ -148,7 +148,7 @@ static void extcap_foreach(gint argc, gchar **args, extcap_cb_t cb, argv = (gchar **) g_malloc0(sizeof(gchar *) * (argc + 2)); -#ifdef WIN32 +#ifdef _WIN32 /* * Make sure executables can find dependent DLLs and that they're *our* * DLLs: https://msdn.microsoft.com/en-us/library/windows/desktop/ms682586.aspx @@ -162,7 +162,7 @@ static void extcap_foreach(gint argc, gchar **args, extcap_cb_t cb, #endif if ((dir = g_dir_open(dirname, 0, NULL)) != NULL) { -#ifdef WIN32 +#ifdef _WIN32 dirname = g_strescape(dirname,NULL); #endif while (keep_going && (file = g_dir_read_name(dir)) != NULL ) { @@ -177,7 +177,7 @@ static void extcap_foreach(gint argc, gchar **args, extcap_cb_t cb, /* full path to extcap binary */ extcap_string = g_string_new(""); -#ifdef WIN32 +#ifdef _WIN32 g_string_printf(extcap_string, "%s\\\\%s",dirname,file); extcap = g_string_free(extcap_string, FALSE); envp = dll_search_envp; @@ -207,7 +207,7 @@ static void extcap_foreach(gint argc, gchar **args, extcap_cb_t cb, g_dir_close(dir); } -#ifdef WIN32 +#ifdef _WIN32 g_strfreev(dll_search_envp); #endif g_free(argv); @@ -469,7 +469,7 @@ void extcap_cleanup(capture_options * capture_opts) { g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_DEBUG, "Extcap [%s] - Cleaning up fifo: %s; PID: %d", interface_opts.name, interface_opts.extcap_fifo, interface_opts.extcap_pid); -#ifdef WIN32 +#ifdef _WIN32 if (pipe_h) { g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_DEBUG, @@ -500,7 +500,7 @@ void extcap_cleanup(capture_options * capture_opts) { if (interface_opts.extcap_pid != INVALID_EXTCAP_PID) { -#ifdef WIN32 +#ifdef _WIN32 TerminateProcess(interface_opts.extcap_pid, 0); #endif g_spawn_close_pid(interface_opts.extcap_pid); @@ -654,7 +654,7 @@ extcaps_init_initerfaces(capture_options *capture_opts) capture_opts->ifaces = g_array_remove_index(capture_opts->ifaces, i); g_array_insert_val(capture_opts->ifaces, i, interface_opts); -#ifdef WIN32 +#ifdef _WIN32 /* On Windows, wait for extcap to connect to named pipe. * Some extcaps will present UAC screen to user. * 30 second timeout should be reasonable timeout for extcap to @@ -727,7 +727,7 @@ extcaps_init_initerfaces(capture_options *capture_opts) return TRUE; } -#ifdef WIN32 +#ifdef _WIN32 /* called by capture_sync to get the CreatNamedPipe handle*/ HANDLE extcap_get_win32_handle() @@ -738,7 +738,7 @@ extcap_get_win32_handle() gboolean extcap_create_pipe(char ** fifo) { -#ifdef WIN32 +#ifdef _WIN32 gchar timestr[ 14+1 ]; time_t current_time; -- cgit v1.2.3