Ethereal-dev: Re: [Ethereal-dev] [CYGWIN]Build hints

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

From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Thu, 13 Nov 2003 11:51:23 -0800

On Nov 13, 2003, at 5:55 AM, Loïc Minier wrote:

 - remove some conditionnal includes (ifdefs), here's a diff -u patch
 that could can read and copy or apply to tethereal.c:
--- tethereal.c 2003-11-01 03:30:15.000000000 +0100
+++ ../ethereal-0.9.16/tethereal.c 2003-11-13 11:18:46.670888000 +0100
@@ -35,9 +35,7 @@
 #include <locale.h>
 #include <limits.h>

-#ifdef HAVE_UNISTD_H
 #include <unistd.h>
-#endif

The configure script is apparently not working on Cygwin, as you presumably have <unistd.h> (otherwise the #include wouldn't work), but it's not setting HAVE_UNISTD_H.

-#ifdef NEED_GETOPT_H
 #include "getopt.h"
-#endif

Cygwin presumably comes with "getopt()", so you shouldn't need Ethereal's own "getopt.h" (or Ethereal's own "getopt()").

-#ifdef _WIN32
 #include "capture-wpcap.h"
-#endif

There needs to be some #define that means "this is Windows, not UNIX" that's defined *EVEN ON CYGWIN*, or else we need to find some #define that means "this is Windows" that's defined on Cygwin and do

	#if defined(_WIN32) || defined(that other #define)

Presumably Cygwin doesn't define _WIN32; does it define WIN32?