In "buffer.h", include <winsock.h> if we have it, so that "u_char" is

defined on Win32 systems - it's not defined in <sys/types.h> on those
systems.

In "buffer.c", include "config.h", to cause HAVE_WINSOCK_H to be
defined, on systems that have it, so that we include it in <buffer.h>.

svn path=/trunk/; revision=2187
This commit is contained in:
Guy Harris 2000-07-31 04:15:58 +00:00
parent 5fb74c28df
commit 0b406c38ba
2 changed files with 9 additions and 5 deletions

View File

@ -1,6 +1,6 @@
/* buffer.c
*
* $Id: buffer.c,v 1.8 2000/07/26 00:20:08 guy Exp $
* $Id: buffer.c,v 1.9 2000/07/31 04:15:58 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org>
@ -20,7 +20,9 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <stdio.h>
#include <stdlib.h>

View File

@ -1,6 +1,6 @@
/* buffer.h
*
* $Id: buffer.h,v 1.5 2000/07/26 00:20:09 guy Exp $
* $Id: buffer.h,v 1.6 2000/07/31 04:15:58 guy Exp $
*
* Wiretap Library
* Copyright (c) 1998 by Gilbert Ramirez <gram@xiexie.org>
@ -23,13 +23,15 @@
#define SOME_FUNCTIONS_ARE_DEFINES
typedef struct Buffer {
#ifdef HAVE_WINSOCK_H
#include <winsock.h> /* to define u_char */
#endif
typedef struct Buffer {
u_char *data;
unsigned int allocated;
unsigned int start;
unsigned int first_free;
} Buffer;
void buffer_init(Buffer* buffer, unsigned int space);