Some old CPP or tools that take C code in input do

not like #preprocessor_macros that do not start at
the first column.

So write:

#ifdef FOO
#  include <dummy1.h>
#  define DUMMY 1
#else
#  include <dummy2.h>
#  define DUMMY 2
#endif

instead of

#ifdef FOO
  #include <dummy1.h>
  #define DUMMY 1
#else
  #include <dummy2.h>
  #define DUMMY 2
#endif

svn path=/trunk/; revision=668
This commit is contained in:
Laurent Deniel 1999-09-12 14:34:36 +00:00
parent a8dc5a1a0c
commit 35d5e37a82
6 changed files with 30 additions and 30 deletions

View File

@ -1,7 +1,7 @@
/* globals.h
* Global defines, etc.
*
* $Id: globals.h,v 1.3 1999/09/10 07:19:40 guy Exp $
* $Id: globals.h,v 1.4 1999/09/12 14:34:18 deniel Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -60,22 +60,22 @@
/* Byte ordering */
#ifndef BYTE_ORDER
#define LITTLE_ENDIAN 4321
#define BIG_ENDIAN 1234
#ifdef WORDS_BIGENDIAN
#define BYTE_ORDER BIG_ENDIAN
#else
#define BYTE_ORDER LITTLE_ENDIAN
#endif
# define LITTLE_ENDIAN 4321
# define BIG_ENDIAN 1234
# ifdef WORDS_BIGENDIAN
# define BYTE_ORDER BIG_ENDIAN
# else
# define BYTE_ORDER LITTLE_ENDIAN
# endif
#endif
/* From the K&R book, p. 89 */
#ifndef MAX
#define MAX(x, y) ((x) > (y) ? (x) : (y))
# define MAX(x, y) ((x) > (y) ? (x) : (y))
#endif
#ifndef MIN
#define MIN(x, y) ((x) < (y) ? (x) : (y))
# define MIN(x, y) ((x) < (y) ? (x) : (y))
#endif
extern FILE *data_out_file;

View File

@ -39,12 +39,12 @@ static int proto_ddp = -1;
/* P = Padding, H = Hops, L = Len */
#if BYTE_ORDER == BIG_ENDIAN
/* PPHHHHLL LLLLLLLL */
#define ddp_hops(x) ( ( x >> 10) & 0x3C )
#define ddp_len(x) ( x & 0x03ff )
# define ddp_hops(x) ( ( x >> 10) & 0x3C )
# define ddp_len(x) ( x & 0x03ff )
#else
/* LLLLLLLL PPHHHHLL*/
#define ddp_hops(x) ( x & 0x3C )
#define ddp_len(x) ( ntohs(x) & 0x03ff )
# define ddp_hops(x) ( x & 0x3C )
# define ddp_len(x) ( ntohs(x) & 0x03ff )
#endif
typedef struct _e_ddp {
guint16 hops_len; /* combines pad, hops, and len */

View File

@ -2,7 +2,7 @@
* Routines for SNMP (simple network management protocol)
* D.Jorand (c) 1998
*
* $Id: packet-snmp.c,v 1.8 1999/08/29 04:15:31 gram Exp $
* $Id: packet-snmp.c,v 1.9 1999/09/12 14:34:18 deniel Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@unicom.net>
@ -30,9 +30,9 @@
#if defined(HAVE_UCD_SNMP_SNMP_H)
#define WITH_SNMP_UCD 1
# define WITH_SNMP_UCD 1
#elif defined(HAVE_SNMP_SNMP_H)
#define WITH_SNMP_CMU 1
# define WITH_SNMP_CMU 1
#endif
#if defined(WITH_SNMP_CMU) || defined(WITH_SNMP_UCD)

View File

@ -1,7 +1,7 @@
/* proto.c
* Routines for protocol tree
*
* $Id: proto.c,v 1.24 1999/09/12 06:11:37 guy Exp $
* $Id: proto.c,v 1.25 1999/09/12 14:34:19 deniel Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -64,9 +64,9 @@
#define cVALS(x) (const value_string*)(x)
#if defined(HAVE_UCD_SNMP_SNMP_H)
#define WITH_SNMP_UCD 1
# define WITH_SNMP_UCD 1
#elif defined(HAVE_SNMP_SNMP_H)
#define WITH_SNMP_CMU 1
# define WITH_SNMP_CMU 1
#endif
static gboolean

10
proto.h
View File

@ -1,7 +1,7 @@
/* proto.h
* Definitions for protocol display
*
* $Id: proto.h,v 1.10 1999/09/12 06:11:38 guy Exp $
* $Id: proto.h,v 1.11 1999/09/12 14:34:20 deniel Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@zing.org>
@ -28,13 +28,13 @@
#define __PROTO_H__
#ifdef HAVE_SYS_TIME_H
#ifndef _SYS_TIME_H
#include <sys/time.h>
#endif
# ifndef _SYS_TIME_H
# include <sys/time.h>
# endif
#endif
#ifdef HAVE_WINSOCK_H
#include <winsock.h>
# include <winsock.h>
#endif
/* needs glib.h */

View File

@ -1,6 +1,6 @@
/* buffer.h
*
* $Id: buffer.h,v 1.2 1998/11/12 06:01:19 gram Exp $
* $Id: buffer.h,v 1.3 1999/09/12 14:34:36 deniel Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@verdict.uthscsa.edu>
@ -39,10 +39,10 @@ void buffer_append(Buffer* buffer, char *from, unsigned int bytes);
void buffer_remove_start(Buffer* buffer, unsigned int bytes);
#ifdef SOME_FUNCTIONS_ARE_DEFINES
#define buffer_increase_length(buffer,bytes) (buffer)->first_free += (bytes)
#define buffer_length(buffer) ((buffer)->first_free - (buffer)->start)
#define buffer_start_ptr(buffer) ((buffer)->data + (buffer)->start)
#define buffer_end_ptr(buffer) ((buffer)->data + (buffer)->first_free)
# define buffer_increase_length(buffer,bytes) (buffer)->first_free += (bytes)
# define buffer_length(buffer) ((buffer)->first_free - (buffer)->start)
# define buffer_start_ptr(buffer) ((buffer)->data + (buffer)->start)
# define buffer_end_ptr(buffer) ((buffer)->data + (buffer)->first_free)
#else
void buffer_increase_length(Buffer* buffer, unsigned int bytes);
unsigned int buffer_length(Buffer* buffer);