aboutsummaryrefslogtreecommitdiffstats
path: root/gtk
diff options
context:
space:
mode:
Diffstat (limited to 'gtk')
-rw-r--r--gtk/capture_if_dlg.c11
-rw-r--r--gtk/dlg_utils.c7
-rw-r--r--gtk/ethclist.c2
-rw-r--r--gtk/font_utils.c8
-rw-r--r--gtk/font_utils.h2
-rw-r--r--gtk/main.c42
-rw-r--r--gtk/menu.c18
-rw-r--r--gtk/prefs_dlg.c2
-rw-r--r--gtk/tcp_graph.c17
-rw-r--r--gtk/ui_util.c2
10 files changed, 59 insertions, 52 deletions
diff --git a/gtk/capture_if_dlg.c b/gtk/capture_if_dlg.c
index d9dea16c63..287bb14397 100644
--- a/gtk/capture_if_dlg.c
+++ b/gtk/capture_if_dlg.c
@@ -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
diff --git a/gtk/dlg_utils.c b/gtk/dlg_utils.c
index 532a249d6b..04ea76510f 100644
--- a/gtk/dlg_utils.c
+++ b/gtk/dlg_utils.c
@@ -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);
}
diff --git a/gtk/ethclist.c b/gtk/ethclist.c
index b263c165b7..4226d46c89 100644
--- a/gtk/ethclist.c
+++ b/gtk/ethclist.c
@@ -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>
diff --git a/gtk/font_utils.c b/gtk/font_utils.c
index 1b263f8aae..056e2d6701 100644
--- a/gtk/font_utils.c
+++ b/gtk/font_utils.c
@@ -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();
diff --git a/gtk/font_utils.h b/gtk/font_utils.h
index ac91a43943..16dcc15d4e 100644
--- a/gtk/font_utils.h
+++ b/gtk/font_utils.h
@@ -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).
*
diff --git a/gtk/main.c b/gtk/main.c
index 0c30b5b59b..f3d418a528 100644
--- a/gtk/main.c
+++ b/gtk/main.c
@@ -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);
diff --git a/gtk/menu.c b/gtk/menu.c
index 7ceb475741..a6bb458cd4 100644
--- a/gtk/menu.c
+++ b/gtk/menu.c
@@ -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) {
diff --git a/gtk/prefs_dlg.c b/gtk/prefs_dlg.c
index b995eed15f..ce6710eb2f 100644
--- a/gtk/prefs_dlg.c
+++ b/gtk/prefs_dlg.c
@@ -53,7 +53,7 @@
#include "prefs-int.h"
#ifdef HAVE_LIBPCAP
-#ifdef WIN32
+#ifdef _WIN32
#include "capture-wpcap.h"
#endif /* _WIN32 */
#endif /* HAVE_LIBPCAP */
diff --git a/gtk/tcp_graph.c b/gtk/tcp_graph.c
index 446a525c01..f287fbf5b9 100644
--- a/gtk/tcp_graph.c
+++ b/gtk/tcp_graph.c
@@ -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)
{
diff --git a/gtk/ui_util.c b/gtk/ui_util.c
index eebc6923e2..c6917104f1 100644
--- a/gtk/ui_util.c
+++ b/gtk/ui_util.c
@@ -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;