Use _WIN32 rather than WIN32 to determine if we're compiling on Win32;

according to Gisle Vanem, WIN32 isn't a built-in in MSVC, but _WIN32 is.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11972 f5534014-38df-0310-8fa8-9805f1628bb7
This commit is contained in:
guy 2004-09-11 23:03:36 +00:00
parent 3c268e2353
commit 649715738e
25 changed files with 108 additions and 101 deletions

View File

@ -171,7 +171,7 @@ get_if_name(char *if_text)
{
char *if_name;
#ifdef WIN32
#ifdef _WIN32
/*
* We cannot assume that the interface name doesn't contain a space;
* some names on Windows OT do.

View File

@ -366,7 +366,7 @@ save_disabled_protos_list(char **pref_path_return, int *errno_return)
return;
}
#ifdef WIN32
#ifdef _WIN32
/* ANSI C doesn't say whether "rename()" removes the target if it
exists; the Win32 call to rename files doesn't do so, which I
infer is the reason why the MSVC++ "rename()" doesn't do so.

View File

@ -46,7 +46,7 @@
* code in tcpdump, to avoid those sorts of problems, and that was
* picked up by tcpdump.org tcpdump.
*/
#if !defined(WIN32) && !defined(__APPLE__)
#if !defined(_WIN32) && !defined(__APPLE__)
#ifndef AVOID_DNS_TIMEOUT
#define AVOID_DNS_TIMEOUT
#endif
@ -95,7 +95,7 @@
# include <adns.h>
#endif
#if defined(WIN32) && defined(INET6)
#if defined(_WIN32) && defined(INET6)
# include <ws2tcpip.h>
#endif

View File

@ -436,7 +436,7 @@ static const fragment_items dcerpc_frag_items = {
/* list of hooks to be called when init_protocols is done */
GHookList dcerpc_hooks_init_protos;
#ifdef WIN32
#ifdef _WIN32
int ResolveWin32UUID(e_uuid_t if_id, char *UUID_NAME, int UUID_NAME_MAX_LEN)
{
char REG_UUID_NAME[MAX_PATH];
@ -1856,7 +1856,7 @@ dcerpc_try_handoff (packet_info *pinfo, proto_tree *tree,
tvbuff_t *volatile stub_tvb;
volatile guint auth_pad_len;
volatile int auth_pad_offset;
#ifdef WIN32
#ifdef _WIN32
char UUID_NAME[MAX_PATH];
#endif
@ -1874,7 +1874,7 @@ dcerpc_try_handoff (packet_info *pinfo, proto_tree *tree,
proto_tree_add_boolean_hidden(dcerpc_tree, hf_dcerpc_unknown_if_id,
tvb, offset, 0, TRUE);
if (check_col (pinfo->cinfo, COL_INFO)) {
#ifdef WIN32
#ifdef _WIN32
if(ResolveWin32UUID(info->call_data->uuid, UUID_NAME, MAX_PATH))
col_append_fstr (pinfo->cinfo, COL_INFO, " [%s] UUID: %08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x rpcver: %u",
UUID_NAME, info->call_data->uuid.Data1, info->call_data->uuid.Data2, info->call_data->uuid.Data3, info->call_data->uuid.Data4[0],
@ -2248,7 +2248,7 @@ dissect_dcerpc_cn_bind (tvbuff_t *tvb, gint offset, packet_info *pinfo,
char uuid_str[DCERPC_UUID_STR_LEN];
int uuid_str_len;
dcerpc_auth_info auth_info;
#ifdef WIN32
#ifdef _WIN32
char UUID_NAME[MAX_PATH];
#endif
@ -2307,7 +2307,7 @@ dissect_dcerpc_cn_bind (tvbuff_t *tvb, gint offset, packet_info *pinfo,
if (uuid_str_len >= DCERPC_UUID_STR_LEN)
memset(uuid_str, 0, DCERPC_UUID_STR_LEN);
#ifdef WIN32
#ifdef _WIN32
if(ResolveWin32UUID(if_id, UUID_NAME, MAX_PATH))
iface_item = proto_tree_add_string_format (ctx_tree, hf_dcerpc_cn_bind_if_id, tvb,
offset, 16, uuid_str, "Interface [%s] UUID: %s", UUID_NAME, uuid_str);
@ -2380,7 +2380,7 @@ dissect_dcerpc_cn_bind (tvbuff_t *tvb, gint offset, packet_info *pinfo,
if ((value = g_hash_table_lookup(dcerpc_uuids, &key)))
col_append_fstr(pinfo->cinfo, COL_INFO, " UUID: %s", value->name);
else
#ifdef WIN32
#ifdef _WIN32
if(ResolveWin32UUID(if_id, UUID_NAME, MAX_PATH))
col_append_fstr(pinfo->cinfo, COL_INFO, " [%s] UUID: %08x-%04x-%04x-%02x%02x-%02x%02x%02x%02x%02x%02x ver %u.%u",
UUID_NAME, if_id.Data1, if_id.Data2, if_id.Data3,

View File

@ -84,9 +84,9 @@
# define netsnmp_ds_set_int ds_set_int
#endif
#ifdef WIN32
#ifdef _WIN32
# include <epan/filesystem.h>
#endif /* WIN32 */
#endif /* _WIN32 */
/*
* Define values "sprint_realloc_value()" expects.
@ -2378,17 +2378,17 @@ process_prefs(void)
if (mib_modules != NULL) {
tmp_mib_modules = g_strconcat("MIBS=", mib_modules, NULL);
#ifdef WIN32
#ifdef _WIN32
_putenv(tmp_mib_modules);
#else
putenv(tmp_mib_modules);
#endif /*WIN32*/
#endif /*_WIN32*/
} else {
#ifdef WIN32
#ifdef _WIN32
_putenv("MIBS");
#else
putenv("MIBS");
#endif /* WIN32 */
#endif /* _WIN32 */
}
/*
@ -2405,7 +2405,7 @@ process_prefs(void)
void
proto_register_snmp(void)
{
#if defined(WIN32) && defined(HAVE_SOME_SNMP)
#if defined(_WIN32) && defined(HAVE_SOME_SNMP)
char *mib_path;
#define MIB_PATH_APPEND "snmp\\mibs"
#endif
@ -2470,7 +2470,7 @@ proto_register_snmp(void)
#ifdef HAVE_SOME_SNMP
#ifdef WIN32
#ifdef _WIN32
/* Set MIBDIRS so that the SNMP library can find its mibs. */
/* XXX - Should we set MIBS or MIBFILES as well? */
@ -2481,7 +2481,7 @@ proto_register_snmp(void)
_putenv(mib_path);
g_free(mib_path);
#endif /* WIN32 */
#endif /* _WIN32 */
/*
* Suppress warnings about unknown tokens - we aren't initializing

View File

@ -49,7 +49,7 @@
#include <direct.h> /* to declare "mkdir()" on Windows */
#endif
#ifndef WIN32
#ifndef _WIN32
#include <pwd.h>
#endif
@ -65,7 +65,7 @@ find_last_pathname_separator(char *path)
{
char *separator;
#ifdef WIN32
#ifdef _WIN32
char c;
/*
@ -235,7 +235,7 @@ test_for_fifo(const char *path)
const char *
get_datafile_dir(void)
{
#ifdef WIN32
#ifdef _WIN32
char prog_pathname[_MAX_PATH+2];
char *dir_end;
size_t datafile_dir_len;
@ -316,7 +316,7 @@ get_datafile_dir(void)
const char *
get_systemfile_dir(void)
{
#ifdef WIN32
#ifdef _WIN32
return get_datafile_dir();
#else
return "/etc";
@ -327,7 +327,7 @@ get_systemfile_dir(void)
* Name of directory, under the user's home directory, in which
* personal configuration files are stored.
*/
#ifdef WIN32
#ifdef _WIN32
#define PF_DIR "Ethereal"
#else
/*
@ -347,7 +347,7 @@ get_systemfile_dir(void)
static const char *
get_persconffile_dir(void)
{
#ifdef WIN32
#ifdef _WIN32
char *appdatadir;
char *userprofiledir;
#else
@ -360,7 +360,7 @@ get_persconffile_dir(void)
if (pf_dir != NULL)
return pf_dir;
#ifdef WIN32
#ifdef _WIN32
/*
* Use %APPDATA% or %USERPROFILE%, so that configuration files are
* stored in the user profile, rather than in the home directory.
@ -436,7 +436,7 @@ int
create_persconffile_dir(char **pf_dir_path_return)
{
const char *pf_dir_path;
#ifdef WIN32
#ifdef _WIN32
char *pf_dir_path_copy, *pf_dir_parent_path;
size_t pf_dir_parent_path_len;
#endif
@ -445,7 +445,7 @@ create_persconffile_dir(char **pf_dir_path_return)
pf_dir_path = get_persconffile_dir();
if (stat(pf_dir_path, &s_buf) != 0 && errno == ENOENT) {
#ifdef WIN32
#ifdef _WIN32
/*
* Does the parent directory of that directory
* exist? %APPDATA% may not exist even though
@ -491,7 +491,7 @@ create_persconffile_dir(char **pf_dir_path_return)
return ret;
}
#ifdef WIN32
#ifdef _WIN32
/*
* Returns the user's home directory on Win32.
*/
@ -562,13 +562,13 @@ get_home_dir(void)
*/
char *
get_persconffile_path(const char *filename, gboolean for_writing
#ifndef WIN32
#ifndef _WIN32
_U_
#endif
)
{
char *path;
#ifdef WIN32
#ifdef _WIN32
struct stat s_buf;
char *old_path;
#endif
@ -577,7 +577,7 @@ get_persconffile_path(const char *filename, gboolean for_writing
strlen(filename) + 2);
sprintf(path, "%s" G_DIR_SEPARATOR_S "%s", get_persconffile_dir(),
filename);
#ifdef WIN32
#ifdef _WIN32
if (!for_writing) {
if (stat(path, &s_buf) != 0 && errno == ENOENT) {
/*

View File

@ -313,7 +313,7 @@ plugins_scan_dir(const char *dirname)
/* Return value is malloced so the caller should g_free() it. */
const char *get_plugins_global_dir(const char *plugin_dir)
{
#ifdef WIN32
#ifdef _WIN32
char *install_plugin_dir;
/*

2
file.c
View File

@ -2910,7 +2910,7 @@ cf_save(char *fname, capture_file *cf, packet_range_t *range, guint save_format)
/* The file being saved is a temporary file from a live
capture, so it doesn't need to stay around under that name;
first, try renaming the capture buffer file to the new name. */
#ifndef WIN32
#ifndef _WIN32
if (rename(cf->filename, fname) == 0) {
/* That succeeded - there's no need to copy the source file. */
from_filename = NULL;

View File

@ -484,7 +484,7 @@ save_filter_list(filter_list_type_t list, char **pref_path_return,
return;
}
#ifdef WIN32
#ifdef _WIN32
/* ANSI C doesn't say whether "rename()" removes the target if it
exists; the Win32 call to rename files doesn't do so, which I
infer is the reason why the MSVC++ "rename()" doesn't do so.

View File

@ -193,7 +193,7 @@ update_if(if_dlg_data_t *if_dlg_data)
*/
if (if_dlg_data->pch) {
if(pcap_stats(if_dlg_data->pch, &stats) >= 0) {
#ifdef WIN32
#ifdef _WIN32
diff = stats.ps_recv - if_dlg_data->last_packets;
if_dlg_data->last_packets = stats.ps_recv;
#else
@ -381,7 +381,12 @@ capture_if_cb(GtkWidget *w _U_, gpointer d _U_)
row = 0;
#ifndef WIN32
#ifndef _WIN32
/*
* On Windows, device names are generally not meaningful - NT 5
* uses long blobs with GUIDs in them, for example - so we don't
* bother showing them.
*/
if_lb = gtk_label_new("Device");
gtk_table_attach_defaults(GTK_TABLE(if_tb), if_lb, 0, 1, row, row+1);
#endif
@ -414,7 +419,7 @@ capture_if_cb(GtkWidget *w _U_, gpointer d _U_)
/* device name */
if_dlg_data->device_lb = gtk_label_new(if_info->name);
if_dlg_data->device = if_info->name;
#ifndef WIN32
#ifndef _WIN32
gtk_misc_set_alignment(GTK_MISC(if_dlg_data->device_lb), 0.0, 0.5);
gtk_table_attach_defaults(GTK_TABLE(if_tb), if_dlg_data->device_lb, 0, 1, row, row+1);
#endif

View File

@ -193,7 +193,8 @@ dlg_button_row_new(gchar *stock_id_first, ...)
gtk_button_box_set_layout (GTK_BUTTON_BOX(button_hbox), GTK_BUTTONBOX_END);
gtk_button_box_set_spacing(GTK_BUTTON_BOX(button_hbox), 5);
#if !WIN32 && GTK_MAJOR_VERSION >= 2
/* GTK+ 1.3 and later - on Win32, we use 1.3[.x] or 2.x, not 1.2[.x] */
#if !defined(_WIN32) && GTK_MAJOR_VERSION >= 2
/* beware: sequence of buttons are important! */
/* XXX: this can be implemented more elegant of course, but it works as it should */
@ -437,14 +438,14 @@ file_selection_set_current_folder(GtkWidget *fs, const gchar *filename)
/* trim filename, so gtk_file_chooser_set_current_folder() likes it, see below */
if (filename[filename_len -1] == G_DIR_SEPARATOR
#ifdef WIN32
#ifdef _WIN32
&& filename_len > 3) /* e.g. "D:\" */
#else
&& filename_len > 1) /* e.g. "/" */
#endif
{
new_filename = g_strdup(filename);
new_filename[filename_len-1] = '\0';
new_filename[filename_len-1] = '\0';
} else {
new_filename = g_strdup(filename);
}

View File

@ -40,7 +40,7 @@
#include <gtk/gtkbindings.h>
#include <gtk/gtkdnd.h>
#ifdef WIN32
#ifdef _WIN32
#include <gdk/win32/gdkwin32.h>
#else
#include <gdk/gdkx.h>

View File

@ -33,7 +33,7 @@
#include <epan/packet.h>
#ifdef WIN32
#ifdef _WIN32
#include <windows.h>
#endif
@ -572,7 +572,7 @@ user_font_apply(void) {
}
#ifdef WIN32
#ifdef _WIN32
#define NAME_BUFFER_LEN 32
@ -712,7 +712,7 @@ static void try_to_get_windows_font_gtk2(void)
}
#endif /* GTK_MAJOR_VERSION */
#endif /* WIN32 */
#endif /* _WIN32 */
void font_init(void)
@ -721,7 +721,7 @@ void font_init(void)
gchar *bold_font_name;
#endif
#ifdef WIN32
#ifdef _WIN32
#if GTK_MAJOR_VERSION >= 2
/* try to load the application font for GTK2 */
try_to_get_windows_font_gtk2();

View File

@ -54,7 +54,7 @@ typedef enum {
*/
extern fa_ret_t user_font_apply(void);
#ifdef WIN32
#ifdef _WIN32
#if GTK_MAJOR_VERSION < 2
/** Init the application font (GTK1 only).
*

View File

@ -64,7 +64,7 @@
#include "getopt.h"
#endif
#ifdef WIN32 /* Needed for console I/O */
#ifdef _WIN32 /* Needed for console I/O */
#include <fcntl.h>
#include <conio.h>
#endif
@ -105,7 +105,7 @@
#ifdef HAVE_LIBPCAP
#include "pcap-util.h"
#endif
#ifdef WIN32
#ifdef _WIN32
#include "capture-wpcap.h"
#endif
@ -163,7 +163,7 @@ static gchar *packets_str = NULL;
GString *comp_info_str, *runtime_info_str;
gchar *ethereal_path = NULL;
#ifdef WIN32
#ifdef _WIN32
static gboolean has_console; /* TRUE if app has console */
/*static void create_console(void);*/
static void destroy_console(void);
@ -990,7 +990,7 @@ print_usage(gboolean print_ver) {
static void
show_version(void)
{
#ifdef WIN32
#ifdef _WIN32
create_console();
#endif
@ -1141,7 +1141,7 @@ get_ring_arguments(const char *arg)
}
#endif
#if defined WIN32 || GTK_MAJOR_VERSION < 2 || ! defined USE_THREADS
#if defined(_WIN32) || GTK_MAJOR_VERSION < 2 || ! defined USE_THREADS
/*
Once every 3 seconds we get a callback here which we use to update
the tap extensions. Since Gtk1 is single threaded we dont have to
@ -1188,14 +1188,14 @@ update_thread(gpointer data _U_)
void
protect_thread_critical_region(void)
{
#if ! defined WIN32 && GTK_MAJOR_VERSION >= 2 && defined USE_THREADS
#if !defined(_WIN32) && GTK_MAJOR_VERSION >= 2 && defined USE_THREADS
g_static_mutex_lock(&update_thread_mutex);
#endif
}
void
unprotect_thread_critical_region(void)
{
#if ! defined WIN32 && GTK_MAJOR_VERSION >= 2 && defined USE_THREADS
#if !defined(_WIN32) && GTK_MAJOR_VERSION >= 2 && defined USE_THREADS
g_static_mutex_unlock(&update_thread_mutex);
#endif
}
@ -1528,9 +1528,9 @@ main(int argc, char *argv[])
extern char *optarg;
gboolean arg_error = FALSE;
#ifdef WIN32
#ifdef _WIN32
WSADATA wsaData;
#endif /* WIN32 */
#endif /* _WIN32 */
char *rf_path;
int rf_open_errno;
@ -1570,11 +1570,11 @@ main(int argc, char *argv[])
#define OPTSTRING_INIT "a:b:B:c:f:Hhi:klLm:nN:o:pP:Qr:R:Ss:t:T:w:vy:z:"
#ifdef HAVE_LIBPCAP
#ifdef WIN32
#ifdef _WIN32
#define OPTSTRING_CHILD "W:Z:"
#else
#define OPTSTRING_CHILD "W:"
#endif /* WIN32 */
#endif /* _WIN32 */
#else
#define OPTSTRING_CHILD ""
#endif /* HAVE_LIBPCAP */
@ -1595,7 +1595,7 @@ main(int argc, char *argv[])
ethereal_path = argv[0];
#ifdef WIN32
#ifdef _WIN32
/* Arrange that if we have no console window, and a GLib message logging
routine is called to log a message, we pop up a console window.
@ -1673,7 +1673,7 @@ main(int argc, char *argv[])
handle_dashG_option(argc, argv, "ethereal");
/* multithread support currently doesn't seem to work in win32 gtk2.0.6 */
#if ! defined WIN32 && GTK_MAJOR_VERSION >= 2 && defined G_THREADS_ENABLED && defined USE_THREADS
#if !defined(_WIN32) && GTK_MAJOR_VERSION >= 2 && defined(G_THREADS_ENABLED) && defined USE_THREADS
{
GThread *ut;
g_thread_init(NULL);
@ -1681,10 +1681,10 @@ main(int argc, char *argv[])
ut=g_thread_create(update_thread, NULL, FALSE, NULL);
g_thread_set_priority(ut, G_THREAD_PRIORITY_LOW);
}
#else /* WIN32 || GTK1.2 || !G_THREADS_ENABLED || !USE_THREADS */
#else /* _WIN32 || GTK1.2 || !G_THREADS_ENABLED || !USE_THREADS */
/* this is to keep tap extensions updating once every 3 seconds */
gtk_timeout_add(3000, (GtkFunction)update_cb,(gpointer)NULL);
#endif /* !WIN32 && GTK2 && G_THREADS_ENABLED */
#endif /* !_WIN32 && GTK2 && G_THREADS_ENABLED */
#if HAVE_GNU_ADNS
gtk_timeout_add(750, (GtkFunction) host_name_lookup_process, NULL);
@ -1827,13 +1827,13 @@ main(int argc, char *argv[])
init_cap_file(&cfile);
#ifdef WIN32
#ifdef _WIN32
/* Load wpcap if possible. Do this before collecting the run-time version information */
load_wpcap();
/* Start windows sockets */
WSAStartup( MAKEWORD( 1, 1 ), &wsaData );
#endif /* WIN32 */
#endif /* _WIN32 */
/* Assemble the compile-time version information string */
comp_info_str = g_string_new("Compiled ");
@ -2048,7 +2048,7 @@ main(int argc, char *argv[])
break;
case 'v': /* Show version and exit */
show_version();
#ifdef WIN32
#ifdef _WIN32
destroy_console();
#endif
exit(0);
@ -2536,7 +2536,7 @@ main(int argc, char *argv[])
epan_cleanup();
g_free(rc_file);
#ifdef WIN32
#ifdef _WIN32
/* Shutdown windows sockets */
WSACleanup();
@ -2556,7 +2556,7 @@ main(int argc, char *argv[])
return 0; /* not reached */
}
#ifdef WIN32
#ifdef _WIN32
/* We build this as a GUI subsystem application on Win32, so
"WinMain()", not "main()", gets called.
@ -2957,7 +2957,7 @@ create_main_window (gint pl_size, gint tv_size, gint bv_size, e_prefs *prefs)
tooltips = gtk_tooltips_new();
#ifdef WIN32
#ifdef _WIN32
#if GTK_MAJOR_VERSION < 2
/* has to be done, after top_level window is created */
app_font_gtk1_init(top_level);

View File

@ -1041,9 +1041,9 @@ add_menu_recent_capture_file_absolute(gchar *cf_name) {
normalized_cf_name = g_strdup(cf_name);
#ifdef WIN32
/* replace all slashes by backslashes */
g_strdelimit(normalized_cf_name, "/", '\\');
#ifdef _WIN32
/* replace all slashes by backslashes */
g_strdelimit(normalized_cf_name, "/", '\\');
#endif
/* get the submenu container item */
@ -1064,15 +1064,15 @@ add_menu_recent_capture_file_absolute(gchar *cf_name) {
* already in the list or
* this element is above maximum count (too old), remove it */
if (!widget_cf_name ||
#ifdef WIN32
/* do a case insensitive compare on win32 */
#ifdef _WIN32
/* do a case insensitive compare on win32 */
#if GLIB_MAJOR_VERSION < 2
g_strncasecmp(widget_cf_name, normalized_cf_name, 1000) == 0 ||
g_strncasecmp(widget_cf_name, normalized_cf_name, 1000) == 0 ||
#else
g_ascii_strncasecmp(widget_cf_name, normalized_cf_name, 1000) == 0 ||
g_ascii_strncasecmp(widget_cf_name, normalized_cf_name, 1000) == 0 ||
#endif
#else /* WIN32 */
/* do a case sensitive compare on unix */
#else /* _WIN32 */
/* do a case sensitive compare on unix */
strncmp(widget_cf_name, normalized_cf_name, 1000) == 0 ||
#endif
cnt >= prefs.gui_recent_files_count_max) {

View File

@ -53,7 +53,7 @@
#include "prefs-int.h"
#ifdef HAVE_LIBPCAP
#ifdef WIN32
#ifdef _WIN32
#include "capture-wpcap.h"
#endif /* _WIN32 */
#endif /* HAVE_LIBPCAP */

View File

@ -502,12 +502,13 @@ static void rtt_put_unack_on_list (struct unack ** , struct unack * );
static void rtt_delete_unack_from_list (struct unack ** , struct unack * );
static void rtt_make_elmtlist (struct graph * );
static void rtt_toggle_seq_origin (struct graph * );
#if defined(WIN32) && !defined(__MINGW32__)
#if defined(_WIN32) && !defined(__MINGW32__)
static int rint (double ); /* compiler template for Windows */
#endif
/* XXX - what about OS X? */
static char helptext[] =
#ifndef WIN32
#ifndef _WIN32
"Here's what you can do:\n\
- Left Mouse Button selects segment in ethereal's packet list\n\
- Middle Mouse Button zooms in\n\
@ -518,7 +519,7 @@ static char helptext[] =
- 's' toggles relative/absolute sequence numbers\n\
- 't' toggles time origin\n\
";
#else /* WIN32 */
#else /* _WIN32 */
"Here's what you can do:\n\
- <ctrl>-Left Mouse Button selects segment in ethereal's packet list\n\
- Left Mouse Button zooms in\n\
@ -2951,7 +2952,7 @@ static gint button_press_event (GtkWidget *widget, GdkEventButton *event)
g->grab.y = (int )rint (event->y) - g->geom.y;
g->grab.grabbed = TRUE;
}
#ifdef WIN32
#ifdef _WIN32
/* Windows mouse control: */
/* [<ctrl>-left] - select packet */
/* [left] - zoom in */
@ -2960,7 +2961,7 @@ static gint button_press_event (GtkWidget *widget, GdkEventButton *event)
if (event->state & GDK_CONTROL_MASK) {
graph_select_segment (g, (int)event->x, (int)event->y);
} else {
#else /* WIN32 */
#else /* _WIN32 */
} else if (event->button == 2) {
#endif
int cur_width = g->geom.width, cur_height = g->geom.height;
@ -3022,10 +3023,10 @@ static gint button_press_event (GtkWidget *widget, GdkEventButton *event)
update_zoom_spins (g);
if (g->cross.draw)
cross_draw (g, (int) event->x, (int) event->y);
#ifndef WIN32
#ifndef _WIN32
} else if (event->button == 1) {
graph_select_segment (g, (int )event->x, (int )event->y);
#else /* WIN32 */
#else /* _WIN32 */
}
#endif
}
@ -3968,7 +3969,7 @@ static void rtt_toggle_seq_origin (struct graph *g)
g->x_axis->min = 0;
}
#if defined(WIN32) && !defined(__MINGW32__)
#if defined(_WIN32) && !defined(__MINGW32__)
/* replacement of Unix rint() for Windows */
static int rint (double x)
{

View File

@ -108,7 +108,7 @@ static gboolean window_geom_load(const gchar *name, window_geometry_t *geom);
static void
window_icon_realize_cb (GtkWidget *win, gpointer data _U_)
{
#ifndef WIN32
#ifndef _WIN32
static GdkPixmap *icon_pmap = NULL;
static GdkBitmap *icon_mask = NULL;
GtkStyle *style;

View File

@ -50,7 +50,7 @@
#include "pcap-util.h"
#include "pcap-util-int.h"
#ifndef WIN32
#ifndef _WIN32
#include <netinet/in.h>
#endif

View File

@ -152,7 +152,7 @@ static gboolean asn1_desegment = TRUE;
static char *asn1_filename = NULL;
static char *old_default_asn1_filename = NULL;
#define OLD_DEFAULT_ASN1FILE "asn1" G_DIR_SEPARATOR_S "default.tt"
#ifdef WIN32
#ifdef _WIN32
#define BAD_SEPARATOR_OLD_DEFAULT_ASN1FILE "asn1/default.tt"
static char *bad_separator_old_default_asn1_filename = NULL;
#endif
@ -2742,7 +2742,7 @@ read_asn1_type_table(char *filename)
* separator.
*/
if ((strcmp(filename, old_default_asn1_filename) != 0
#ifdef WIN32
#ifdef _WIN32
&& strcmp(filename, bad_separator_old_default_asn1_filename) != 0
#endif
) || errno != ENOENT)
@ -2791,7 +2791,7 @@ read_asn1_type_table(char *filename)
get_values();
g_node_destroy(asn1_nodes); asn1_nodes = 0;
#ifndef WIN32 /* tvb_free not yet exported to plugins... */
#ifndef _WIN32 /* tvb_free not yet exported to plugins... */
tvb_free(asn1_desc);
#endif
asn1_desc = 0;
@ -4995,7 +4995,7 @@ proto_register_asn1(void) {
&asn1_desegment);
old_default_asn1_filename = get_datafile_path(OLD_DEFAULT_ASN1FILE);
#ifdef WIN32
#ifdef _WIN32
bad_separator_old_default_asn1_filename = get_datafile_path(BAD_SEPARATOR_OLD_DEFAULT_ASN1FILE);
#endif

View File

@ -941,7 +941,7 @@ read_prefs(int *gpf_errno_return, int *gpf_read_errno_return,
prefs.gui_hex_dump_highlight_style = 1;
prefs.filter_toolbar_show_in_statusbar = FALSE;
prefs.gui_toolbar_main_style = TB_STYLE_ICONS;
#ifdef WIN32
#ifdef _WIN32
prefs.gui_font_name1 = g_strdup("-*-lucida console-medium-r-*-*-*-100-*-*-*-*-*-*");
prefs.gui_font_name2 = g_strdup("Lucida Console 10");
#else

6
util.c
View File

@ -161,7 +161,7 @@ try_tempfile(char *namebuf, int namebuflen, const char *dir, const char *pfx)
}
static char *tmpdir = NULL;
#ifdef WIN32
#ifdef _WIN32
static char *temp = NULL;
#endif
static char *E_tmpdir;
@ -180,7 +180,7 @@ create_tempfile(char *namebuf, int namebuflen, const char *pfx)
if (!initialized) {
if ((dir = getenv("TMPDIR")) != NULL)
tmpdir = setup_tmpdir(dir);
#ifdef WIN32
#ifdef _WIN32
if ((dir = getenv("TEMP")) != NULL)
temp = setup_tmpdir(dir);
#endif
@ -195,7 +195,7 @@ create_tempfile(char *namebuf, int namebuflen, const char *pfx)
return fd;
}
#ifdef WIN32
#ifdef _WIN32
if (temp != NULL) {
fd = try_tempfile(namebuf, namebuflen, temp, pfx);
if (fd != -1)

View File

@ -201,7 +201,7 @@ get_compiled_version_info(GString *str)
void
get_runtime_version_info(GString *str)
{
#if defined(WIN32)
#if defined(_WIN32)
OSVERSIONINFO info;
#elif defined(HAVE_SYS_UTSNAME_H)
struct utsname name;
@ -210,7 +210,7 @@ get_runtime_version_info(GString *str)
get_runtime_pcap_version(str);
g_string_append(str, "on ");
#if defined(WIN32)
#if defined(_WIN32)
info.dwOSVersionInfoSize = sizeof info;
if (!GetVersionEx(&info)) {
/*

View File

@ -121,7 +121,7 @@ extern void xmlCheckVersion(int version);
#endif
#ifndef LIBXML_DLL_IMPORT
#if defined(WIN32) && !defined(STATIC)
#if defined(_WIN32) && !defined(STATIC)
#define LIBXML_DLL_IMPORT __declspec(dllimport)
#else
#define LIBXML_DLL_IMPORT
@ -188,7 +188,7 @@ typedef enum {
typedef unsigned char xmlChar;
#ifndef WIN32
#ifndef _WIN32
#ifndef CHAR
#define CHAR xmlChar
#endif
@ -1097,7 +1097,7 @@ typedef struct {
XML_EXTERN XML_STUB XmlStub;
XML_EXTERN int XmlStubInitialized;
#ifdef WIN32
#ifdef _WIN32
/* We're in windows, use the windows filename */
#define XML_LIBRARY "libxml2.dll"
#else