2 * ngIRCd -- The Next Generation IRC Daemon
3 * Copyright (c)2001-2003 by 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.18 2005/03/19 18:43:50 fw Exp $
13 * Portability functions and declarations (header for libngbportab).
23 #ifdef HAVE_SYS_TYPES_H
24 # include <sys/types.h>
27 #ifdef HAVE_INTTYPES_H
28 # include <inttypes.h>
29 # define NGIRC_GOT_INTTYPES
33 # define NGIRC_GOT_INTTYPES
45 /* compiler features */
47 #if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7))
48 # define PUNUSED(x) __attribute__ ((unused)) x
49 # define UNUSED __attribute__ ((unused))
57 # define PARAMS(args) args
59 # define PARAMS(args) ()
77 #ifdef NGIRC_GOT_INTTYPES
78 typedef uint8_t UINT8;
79 typedef uint16_t UINT16;
80 typedef uint32_t UINT32;
82 typedef unsigned char UINT8;
83 typedef unsigned short UINT16;
84 typedef unsigned int UINT32;
87 #ifndef HAVE_STDBOOL_H
88 typedef unsigned char bool;
95 # define NULL (void *)0
113 /* target constants */
116 #define TARGET_OS "unknown"
120 #define TARGET_CPU "unknown"
123 #ifndef TARGET_VENDOR
124 #define TARGET_VENDOR "unknown"
128 /* configure options */
130 #ifndef HAVE_socklen_t
131 #define socklen_t int /* u.a. fuer Mac OS X */
134 #ifndef HAVE_SNPRINTF
135 extern int snprintf PARAMS(( char *str, size_t count, const char *fmt, ... ));
139 extern size_t strlcat PARAMS(( char *dst, const char *src, size_t size ));
143 extern size_t strlcpy PARAMS(( char *dst, const char *src, size_t size ));
146 #ifndef HAVE_VSNPRINTF
148 extern int vsnprintf PARAMS(( char *str, size_t count, const char *fmt, va_list args ));
152 #define PACKAGE_NAME PACKAGE
155 #ifndef PACKAGE_VERSION
156 #define PACKAGE_VERSION VERSION