Ethereal-dev: [Ethereal-dev] MSVC build process broken in current svn

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Lars Roland <lars.roland@xxxxxxx>
Date: Sat, 24 Jul 2004 21:57:23 +0200
Hello all,

attached patches make the MSVC build process work again.

In gtk/font_utils.c: epan/packet.h must be included before windows.h on Win32.

In capture_combo_utils.c and color_filters.c:
define _NEED_VAR_IMPORT_ to import variables from libethereal.dll if necessary. This is a workaround and is necessary as long as we have sources in /trunk which are linked into libethereal.dll. Once we have moved all these sources from /trunk into a subdirectory, we can define _NEED_VAR_IMPORT_ in the nmake makefile, as it is done in trunk/gtk.

In epan/dissectors/makefile.nmake:
Remove more files with distclean

Please check in.

Regards,
Lars
Index: ethereal-svn/capture_combo_utils.c
===================================================================
--- ethereal-svn/capture_combo_utils.c	(revision 11506)
+++ ethereal-svn/capture_combo_utils.c	(working copy)
@@ -22,6 +22,10 @@
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  */
 
+/* With MSVC and a libethereal.dll this file needs to import some variables 
+   in a special way. Therefore _NEED_VAR_IMPORT_ is defined. */  
+#define _NEED_VAR_IMPORT_
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
Index: ethereal-svn/gtk/font_utils.c
===================================================================
--- ethereal-svn/gtk/font_utils.c	(revision 11506)
+++ ethereal-svn/gtk/font_utils.c	(working copy)
@@ -31,6 +31,8 @@
 #include <stdlib.h>
 #include <stdio.h>
 
+#include <epan/packet.h>
+
 #ifdef WIN32
 #include <windows.h>
 #endif
@@ -44,7 +46,6 @@
 #include "font_utils.h"
 #include "simple_dialog.h"
 
-#include <epan/packet.h>
 #include "packet_list.h"
 #include "proto_draw.h"
 #include "follow_dlg.h"
Index: ethereal-svn/color_filters.c
===================================================================
--- ethereal-svn/color_filters.c	(revision 11506)
+++ ethereal-svn/color_filters.c	(working copy)
@@ -24,6 +24,11 @@
 /*
  * Updated 1 Dec 10 jjm
  */
+
+/* With MSVC and a libethereal.dll this file needs to import some variables 
+   in a special way. Therefore _NEED_VAR_IMPORT_ is defined. */  
+#define _NEED_VAR_IMPORT_ 
+ 
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
Index: ethereal-svn/epan/dissectors/Makefile.nmake
===================================================================
--- ethereal-svn/epan/dissectors/Makefile.nmake	(revision 11506)
+++ ethereal-svn/epan/dissectors/Makefile.nmake	(working copy)
@@ -25,7 +25,7 @@
 
 #dissectors.lib: ../../config.h $(DISSECTOR_OBJECTS) $(EXTRA_OBJECTS)
 dissectors.lib: register.obj packet-ncp2222.c x11-declarations.h x11-register-info.h ../../config.h $(DISSECTOR_OBJECTS) $(DISSECTOR_SUPPORT_OBJECTS)
-	echo dissectors.lib
+	@echo Linking dissectors.lib
 	link /lib /out:dissectors.lib $(DISSECTOR_OBJECTS) $(DISSECTOR_SUPPORT_OBJECTS)
 
 #
@@ -99,4 +99,5 @@
 		$(DISSECTOR_OBJECTS) $(DISSECTOR_SUPPORT_OBJECTS)
 
 distclean: clean
-	rm -f $(BUILT_SOURCES) packet-ncp2222.c
+	rm -f $(BUILT_SOURCES) packet-ncp2222.c \
+		register.c x11-declarations.h x11-register-info.h