X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fportab%2Fportab.h;h=ef376c8066f90bf382cd93b9c26367335e3c4bcc;hb=4d0b03b4235a1150ed7182fba31ee658d3979625;hp=c911613c08f274c04d6c164db117f079c0b5c1a1;hpb=f53455977d21d2bb98a7cc0f06006d40715d6812;p=ngircd-alex.git diff --git a/src/portab/portab.h b/src/portab/portab.h index c911613c..ef376c80 100644 --- a/src/portab/portab.h +++ b/src/portab/portab.h @@ -8,7 +8,7 @@ * (at your option) any later version. * Please read the file COPYING, README and AUTHORS for more information. * - * $Id: portab.h,v 1.14 2003/03/17 01:12:10 alex Exp $ + * $Id: portab.h,v 1.19 2005/03/30 16:37:02 alex Exp $ * * Portability functions and declarations (header for libngbportab). */ @@ -20,14 +20,35 @@ #include "config.h" +#ifndef DEBUG +# define NDEBUG +#endif + #ifdef HAVE_SYS_TYPES_H -#include +# include +#endif + +#ifdef HAVE_INTTYPES_H +# include +# define NGIRC_GOT_INTTYPES +#else +# ifdef HAVE_STDINT_H +# include +# define NGIRC_GOT_INTTYPES +# endif #endif +#ifdef HAVE_STDDEF_H +# include +#endif + +#ifdef HAVE_STDBOOL_H +# include +#endif /* compiler features */ -#ifdef __GNUC__ +#if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7)) # define PUNUSED(x) __attribute__ ((unused)) x # define UNUSED __attribute__ ((unused)) #else @@ -45,13 +66,7 @@ /* keywords */ - -#define EXTERN extern -#define STATIC static #define LOCAL static -#define CONST const -#define REGISTER register - /* datatypes */ @@ -61,40 +76,31 @@ # endif #endif -typedef void VOID; typedef void POINTER; -typedef signed int INT; -typedef unsigned int UINT; -typedef signed long LONG; -typedef unsigned long ULONG; - -typedef signed char INT8; +#ifdef NGIRC_GOT_INTTYPES +typedef uint8_t UINT8; +typedef uint16_t UINT16; +typedef uint32_t UINT32; +#else typedef unsigned char UINT8; -typedef signed short INT16; typedef unsigned short UINT16; -typedef signed long INT32; -typedef unsigned long UINT32; - -typedef double DOUBLE; -typedef float FLOAT; - -typedef char CHAR; - -typedef UINT8 BOOLEAN; - -#undef TRUE -#define TRUE (BOOLEAN)1 +typedef unsigned int UINT32; +#endif -#undef FALSE -#define FALSE (BOOLEAN)0 +#ifndef HAVE_STDBOOL_H +typedef unsigned char bool; +#define true (bool)1 +#define false (bool)0 +#endif -#undef NULL +#ifndef NULL #ifdef PROTOTYPES -# define NULL (VOID *)0 +# define NULL (void *)0 #else # define NULL 0L #endif +#endif #undef GLOBAL #define GLOBAL @@ -130,20 +136,28 @@ typedef UINT8 BOOLEAN; #endif #ifndef HAVE_SNPRINTF -EXTERN INT snprintf PARAMS(( CHAR *str, size_t count, CONST CHAR *fmt, ... )); +extern int snprintf PARAMS(( char *str, size_t count, const char *fmt, ... )); #endif #ifndef HAVE_STRLCAT -EXTERN size_t strlcat PARAMS(( CHAR *dst, CONST CHAR *src, size_t size )); +extern size_t strlcat PARAMS(( char *dst, const char *src, size_t size )); #endif #ifndef HAVE_STRLCPY -EXTERN size_t strlcpy PARAMS(( CHAR *dst, CONST CHAR *src, size_t size )); +extern size_t strlcpy PARAMS(( char *dst, const char *src, size_t size )); #endif #ifndef HAVE_VSNPRINTF #include -EXTERN INT vsnprintf PARAMS(( CHAR *str, size_t count, CONST CHAR *fmt, va_list args )); +extern int vsnprintf PARAMS(( char *str, size_t count, const char *fmt, va_list args )); +#endif + +#ifndef PACKAGE_NAME +#define PACKAGE_NAME PACKAGE +#endif + +#ifndef PACKAGE_VERSION +#define PACKAGE_VERSION VERSION #endif