forked from osmocom/wireshark
getopt() can/should normally be found in unistd.h, so: - When testing for getopt(), define that we HAVE_GETOPT instead of HAVE_GETOPT_H (to avoid confusion). - Don't attempt to include getopt.h: not all OS's have it (for example, Solaris 9 does not). - (All the places which need getopt already include unistd.h (if we have it).) If this breaks things on some OS, we might need (a real) HAVE_GETOPT_H check. svn path=/trunk/; revision=38437daniel/osmux
parent
a60d91018f
commit
bf95c7b5e4
|
@ -88,9 +88,7 @@
|
|||
#include <wsutil/file_util.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GETOPT_H
|
||||
#include <getopt.h>
|
||||
#else
|
||||
#ifndef HAVE_GETOPT
|
||||
#include "wsutil/wsgetopt.h"
|
||||
#endif
|
||||
|
||||
|
|
|
@ -1742,7 +1742,7 @@ AC_PROG_GCC_TRADITIONAL
|
|||
GETOPT_LO=""
|
||||
AC_CHECK_FUNC(getopt,
|
||||
[GETOPT_LO=""
|
||||
AC_DEFINE(HAVE_GETOPT_H, 1, [Define to 1 if you have the <getopt.h> header file.])
|
||||
AC_DEFINE(HAVE_GETOPT, 1, [Define to 1 if you have the getopt function.])
|
||||
],
|
||||
GETOPT_LO="wsgetopt.lo"
|
||||
)
|
||||
|
|
|
@ -59,9 +59,7 @@
|
|||
#include <signal.h>
|
||||
#include <errno.h>
|
||||
|
||||
#ifdef HAVE_GETOPT_H
|
||||
#include <getopt.h>
|
||||
#else
|
||||
#ifndef HAVE_GETOPT
|
||||
#include "wsutil/wsgetopt.h"
|
||||
#endif
|
||||
|
||||
|
|
|
@ -42,9 +42,7 @@
|
|||
|
||||
#include "wtap.h"
|
||||
|
||||
#ifdef HAVE_GETOPT_H
|
||||
#include <getopt.h>
|
||||
#else
|
||||
#ifndef HAVE_GETOPT
|
||||
#include "wsutil/wsgetopt.h"
|
||||
#endif
|
||||
|
||||
|
|
|
@ -45,9 +45,7 @@
|
|||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GETOPT_H
|
||||
#include <getopt.h>
|
||||
#else
|
||||
#ifndef HAVE_GETOPT
|
||||
#include "wsutil/wsgetopt.h"
|
||||
#endif
|
||||
|
||||
|
|
|
@ -27,9 +27,7 @@
|
|||
#include <string.h>
|
||||
#include "wtap.h"
|
||||
|
||||
#ifdef HAVE_GETOPT_H
|
||||
#include <getopt.h>
|
||||
#else
|
||||
#ifndef HAVE_GETOPT
|
||||
#include "wsutil/wsgetopt.h"
|
||||
#endif
|
||||
|
||||
|
|
10
randpkt.c
10
randpkt.c
|
@ -27,16 +27,14 @@
|
|||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GETOPT_H
|
||||
#include <getopt.h>
|
||||
#else
|
||||
#include "wsutil/wsgetopt.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_UNISTD_H
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifndef HAVE_GETOPT
|
||||
#include "wsutil/wsgetopt.h"
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_FCNTL_H
|
||||
#include <fcntl.h>
|
||||
#endif
|
||||
|
|
|
@ -61,9 +61,7 @@
|
|||
# include <sys/stat.h>
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_GETOPT_H
|
||||
#include <getopt.h>
|
||||
#else
|
||||
#ifndef HAVE_GETOPT
|
||||
#include "wsutil/wsgetopt.h"
|
||||
#endif
|
||||
|
||||
|
|
|
@ -125,9 +125,7 @@
|
|||
#include <errno.h>
|
||||
#include <assert.h>
|
||||
|
||||
#ifdef HAVE_GETOPT_H
|
||||
#include <getopt.h>
|
||||
#else
|
||||
#ifndef HAVE_GETOPT
|
||||
#include "wsutil/wsgetopt.h"
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue