2 d18ca0b8 2002-03-12 alex * ngIRCd -- The Next Generation IRC Daemon
3 ca8ab38c 2005-04-09 alex * Copyright (c)2001-2005 Alexander Barton (alex@barton.de)
5 e13cb291 2002-12-26 alex * This program is free software; you can redistribute it and/or modify
6 e13cb291 2002-12-26 alex * it under the terms of the GNU General Public License as published by
7 e13cb291 2002-12-26 alex * the Free Software Foundation; either version 2 of the License, or
8 e13cb291 2002-12-26 alex * (at your option) any later version.
9 e13cb291 2002-12-26 alex * Please read the file COPYING, README and AUTHORS for more information.
11 77f54693 2005-07-31 alex * $Id: portab.h,v 1.22 2005/07/31 20:13:11 alex Exp $
13 e13cb291 2002-12-26 alex * Portability functions and declarations (header for libngbportab).
17 d18ca0b8 2002-03-12 alex #ifndef __PORTAB__
18 d18ca0b8 2002-03-12 alex #define __PORTAB__
21 d18ca0b8 2002-03-12 alex #include "config.h"
23 4d0b03b4 2005-03-30 alex #ifndef DEBUG
24 4d0b03b4 2005-03-30 alex # define NDEBUG
27 4f6f84e7 2002-12-26 alex #ifdef HAVE_SYS_TYPES_H
28 c53903eb 2004-01-17 alex # include <sys/types.h>
31 8adff592 2005-03-19 fw #ifdef HAVE_INTTYPES_H
32 8adff592 2005-03-19 fw # include <inttypes.h>
33 8adff592 2005-03-19 fw # define NGIRC_GOT_INTTYPES
35 8adff592 2005-03-19 fw # ifdef HAVE_STDINT_H
36 8adff592 2005-03-19 fw # include <stdint.h>
37 8adff592 2005-03-19 fw # define NGIRC_GOT_INTTYPES
41 8adff592 2005-03-19 fw #ifdef HAVE_STDDEF_H
42 8adff592 2005-03-19 fw # include <stddef.h>
45 8adff592 2005-03-19 fw #ifdef HAVE_STDBOOL_H
46 8adff592 2005-03-19 fw # include <stdbool.h>
49 e13cb291 2002-12-26 alex /* compiler features */
51 f697923c 2004-03-15 alex #if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 7))
52 6725d789 2002-12-12 alex # define PUNUSED(x) __attribute__ ((unused)) x
53 6725d789 2002-12-12 alex # define UNUSED __attribute__ ((unused))
55 6725d789 2002-12-12 alex # define PUNUSED(x) x
56 6725d789 2002-12-12 alex # define UNUSED
59 ba258e65 2002-05-27 alex #ifndef PARAMS
60 ba258e65 2002-05-27 alex # if PROTOTYPES
61 ba258e65 2002-05-27 alex # define PARAMS(args) args
63 ba258e65 2002-05-27 alex # define PARAMS(args) ()
68 e13cb291 2002-12-26 alex /* datatypes */
70 ba258e65 2002-05-27 alex #ifndef PROTOTYPES
71 ba258e65 2002-05-27 alex # ifndef signed
72 ba258e65 2002-05-27 alex # define signed
76 d18ca0b8 2002-03-12 alex typedef void POINTER;
78 8adff592 2005-03-19 fw #ifdef NGIRC_GOT_INTTYPES
79 8adff592 2005-03-19 fw typedef uint8_t UINT8;
80 8adff592 2005-03-19 fw typedef uint16_t UINT16;
81 8adff592 2005-03-19 fw typedef uint32_t UINT32;
83 d18ca0b8 2002-03-12 alex typedef unsigned char UINT8;
84 d18ca0b8 2002-03-12 alex typedef unsigned short UINT16;
85 8adff592 2005-03-19 fw typedef unsigned int UINT32;
88 8adff592 2005-03-19 fw #ifndef HAVE_STDBOOL_H
89 8adff592 2005-03-19 fw typedef unsigned char bool;
90 8adff592 2005-03-19 fw #define true (bool)1
91 8adff592 2005-03-19 fw #define false (bool)0
95 ba258e65 2002-05-27 alex #ifdef PROTOTYPES
96 8adff592 2005-03-19 fw # define NULL (void *)0
98 ba258e65 2002-05-27 alex # define NULL 0L
102 d18ca0b8 2002-03-12 alex #undef GLOBAL
103 d18ca0b8 2002-03-12 alex #define GLOBAL
106 8d79f267 2002-03-25 alex /* SPLint */
109 8d79f267 2002-03-25 alex #ifdef S_SPLINT_S
110 8d79f267 2002-03-25 alex #include "splint.h"
114 e13cb291 2002-12-26 alex /* target constants */
116 e13cb291 2002-12-26 alex #ifndef TARGET_OS
117 e13cb291 2002-12-26 alex #define TARGET_OS "unknown"
120 e13cb291 2002-12-26 alex #ifndef TARGET_CPU
121 e13cb291 2002-12-26 alex #define TARGET_CPU "unknown"
124 e13cb291 2002-12-26 alex #ifndef TARGET_VENDOR
125 e13cb291 2002-12-26 alex #define TARGET_VENDOR "unknown"
129 e13cb291 2002-12-26 alex /* configure options */
131 d18ca0b8 2002-03-12 alex #ifndef HAVE_socklen_t
132 ca8ab38c 2005-04-09 alex typedef int socklen_t; /* for Mac OS X, amongst others */
135 e13cb291 2002-12-26 alex #ifndef HAVE_SNPRINTF
136 8adff592 2005-03-19 fw extern int snprintf PARAMS(( char *str, size_t count, const char *fmt, ... ));
139 e13cb291 2002-12-26 alex #ifndef HAVE_STRLCAT
140 8adff592 2005-03-19 fw extern size_t strlcat PARAMS(( char *dst, const char *src, size_t size ));
143 e13cb291 2002-12-26 alex #ifndef HAVE_STRLCPY
144 8adff592 2005-03-19 fw extern size_t strlcpy PARAMS(( char *dst, const char *src, size_t size ));
147 77faf14b 2005-04-16 fw #ifndef HAVE_STRDUP
148 77faf14b 2005-04-16 fw extern char * strdup PARAMS(( const char *s ));
151 e13cb291 2002-12-26 alex #ifndef HAVE_VSNPRINTF
152 f5345597 2003-03-17 alex #include <stdarg.h>
153 8adff592 2005-03-19 fw extern int vsnprintf PARAMS(( char *str, size_t count, const char *fmt, va_list args ));
156 016e547d 2003-03-31 alex #ifndef PACKAGE_NAME
157 016e547d 2003-03-31 alex #define PACKAGE_NAME PACKAGE
160 016e547d 2003-03-31 alex #ifndef PACKAGE_VERSION
161 016e547d 2003-03-31 alex #define PACKAGE_VERSION VERSION
168 d18ca0b8 2002-03-12 alex /* -eof- */