2 * ngIRCd -- The Next Generation IRC Daemon
3 * Copyright (c)2001-2005 Alexander Barton (alex@barton.de)
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 * Please read the file COPYING, README and AUTHORS for more information.
11 * $Id: portab.h,v 1.22 2005/07/31 20:13:11 alex Exp $
13 * Portability functions and declarations (header for libngbportab).
27 #ifdef HAVE_SYS_TYPES_H
28 # include <sys/types.h>
31 #ifdef HAVE_INTTYPES_H
32 # include <inttypes.h>
33 # define NGIRC_GOT_INTTYPES
37 # define NGIRC_GOT_INTTYPES
49 /* compiler features */
51 #if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7))
52 # define PUNUSED(x) __attribute__ ((unused)) x
53 # define UNUSED __attribute__ ((unused))
61 # define PARAMS(args) args
63 # define PARAMS(args) ()
78 #ifdef NGIRC_GOT_INTTYPES
79 typedef uint8_t UINT8;
80 typedef uint16_t UINT16;
81 typedef uint32_t UINT32;
83 typedef unsigned char UINT8;
84 typedef unsigned short UINT16;
85 typedef unsigned int UINT32;
88 #ifndef HAVE_STDBOOL_H
89 typedef unsigned char bool;
96 # define NULL (void *)0
114 /* target constants */
117 #define TARGET_OS "unknown"
121 #define TARGET_CPU "unknown"
124 #ifndef TARGET_VENDOR
125 #define TARGET_VENDOR "unknown"
129 /* configure options */
131 #ifndef HAVE_socklen_t
132 typedef int socklen_t; /* for Mac OS X, amongst others */
135 #ifndef HAVE_SNPRINTF
136 extern int snprintf PARAMS(( char *str, size_t count, const char *fmt, ... ));
140 extern size_t strlcat PARAMS(( char *dst, const char *src, size_t size ));
144 extern size_t strlcpy PARAMS(( char *dst, const char *src, size_t size ));
148 extern char * strdup PARAMS(( const char *s ));
151 #ifndef HAVE_VSNPRINTF
153 extern int vsnprintf PARAMS(( char *str, size_t count, const char *fmt, va_list args ));
157 #define PACKAGE_NAME PACKAGE
160 #ifndef PACKAGE_VERSION
161 #define PACKAGE_VERSION VERSION