Commit Graph

9 Commits

Author SHA1 Message Date
Gilbert Ramirez c24adacff7 <sys/types.h> still needs to be #included to get size_t, as the comment
which was not deleted makes clear.

svn path=/trunk/; revision=6288
2002-09-12 21:26:51 +00:00
Jörg Mayer 173fe5aef4 Replace the types from sys/types.h and netinet/in.h by their glib.h
equivalents for the toplevel directory. The removal of winsock2.h will
hopefully not cause any problems under MSVC++, as those files using
struct timeval still include wtap.h, which still includes winsock2.h.

svn path=/trunk/; revision=5932
2002-08-02 23:36:07 +00:00
Uwe Girlich 372fe49be8 Include sys/types.h to provide the type size_t, which is needed
further down in this file but must not be defined yet in the C source,
which includes this header file.
Example: without this change, packet-dcerpc-samr.c 1.51 could not be
compiled under SINIX-M.

svn path=/trunk/; revision=5894
2002-07-19 12:59:21 +00:00
Guy Harris cc21ec8124 Do __attribute__ stuff if the GCC version number is greater than or
equal to 2, not just if it's equal to 2 - GCC 3.0 makes it 3, not 2....

svn path=/trunk/; revision=3765
2001-07-22 10:25:50 +00:00
Guy Harris 90eccd89b8 Some compilers, e.g. Microsoft Visual C++, don't define __STDC__ unless
extensions to ANSI C are disabled if they may cause strictly conforming
programs not to compile, or to work differently if those extensions are
enabled.  (Other compilers #define it as 0, e.g.  Sun's and, I think,
other AT&T-derived compilers; still others cheerfully define it as 1
even when those extensions are enabled, e.g. GCC.)

As such, checking whether __STDC__ is defined, or is defined as a
non-zero value, isn't the right way to check whether function prototypes
are supported; MSVC++ 6.0 supports them, but, by default, leaves
extensions of the sort described above enabled, and thus doesn't define
__STDC__.  This means that the compiler warns about arguments to
"snprintf()" when compiling it, as the declaration is an old-style
declaration.

As Ethereal uses function prototypes, there's not much point in making
it possible for its private "snprintf()" to be compiled or used when
function prototypes aren't supported; just get rid of the tests for
__STDC__, so that it's compiled with function prototypes regardless of
whether __STDC__ is defined or not.

While we're at it, have "snprintf()" give it a "__attribute__((format
(printf, 3, 4))))" when compiled by GCC 2.x or later, so that
format/argument checks can be done even on platforms lacking
"snprintf()".

svn path=/trunk/; revision=2689
2000-11-21 21:24:52 +00:00
Guy Harris a14e4940eb Give it an RCS ID.
svn path=/trunk/; revision=2256
2000-08-11 22:00:49 +00:00
Laurent Deniel 6a480953a9 Miscellaneous code cleaning
- add <stdarg.h> or <varargs.h> in snprintf.h
  and remove those inclusions in the other #ifdef NEED_SNPRINTF_H codes

- remove the check of multiple inclusions in source (.c)  code
  (there is a bit loss of _cpp_ performance, but I prefer the gain of
   code reading and maintenance; and nowadays, disk caches and VM are
   correctly optimized ;-).

- protect all (well almost) header files against multiple inclusions

- add header (i.e. GPL license) in some include files

- reorganize a bit the way header files are included:

  First:
  #include <system_include_files>
  #include <external_package_include_files (e.g. gtk, glib etc.)>
  Then
  #include "ethereal_include_files"

  with the correct HAVE_XXX or NEED_XXX protections.

- add some HAVE_XXX checks before including some system header files

- add the same HAVE_XXX in wiretap as in ethereal

Please forgive me, if I break something (I've only compiled and regression
tested on Linux).

svn path=/trunk/; revision=2254
2000-08-11 13:37:21 +00:00
Guy Harris d0b809aa74 Squelch a number of "-Wall" errors by:
1) renaming "snprintf.h" to "snprintf-imp.h" (it contains stuff
	   used by the "snprintf()" *implementation*, but not stuff it
	   *exports*);

	2) creating a new "snprintf.h" to declare "vsnprintf()" and
	   "snprintf()";

	3) removing an unused variable;

	4) fixing a call to "add_item_to_tree()" to handle the
	   possibility of "ntohl()" returning a "long" rather than an
	   "int".

svn path=/trunk/; revision=47
1998-10-13 07:03:37 +00:00
Gerald Combs 86534f46e1 Initial revision
svn path=/trunk/; revision=2
1998-09-16 02:39:15 +00:00