Blob


1 /*
2 * ngIRCd -- The Next Generation IRC Daemon
3 * Copyright (c)2001,2002 by Alexander Barton (alex@barton.de)
4 *
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.
10 *
11 * $Id: portab.h,v 1.12 2003/01/03 22:03:51 alex Exp $
12 *
13 * Portability functions and declarations (header for libngbportab).
14 */
17 #ifndef __PORTAB__
18 #define __PORTAB__
21 #include "config.h"
23 #ifdef HAVE_SYS_TYPES_H
24 #include <sys/types.h>
25 #endif
28 /* compiler features */
30 #ifdef __GNUC__
31 # define PUNUSED(x) __attribute__ ((unused)) x
32 # define UNUSED __attribute__ ((unused))
33 #else
34 # define PUNUSED(x) x
35 # define UNUSED
36 #endif
38 #ifndef PARAMS
39 # if PROTOTYPES
40 # define PARAMS(args) args
41 # else
42 # define PARAMS(args) ()
43 # endif
44 #endif
47 /* keywords */
49 #define EXTERN extern
50 #define STATIC static
51 #define LOCAL static
52 #define CONST const
53 #define REGISTER register
56 /* datatypes */
58 #ifndef PROTOTYPES
59 # ifndef signed
60 # define signed
61 # endif
62 #endif
64 typedef void VOID;
65 typedef void POINTER;
67 typedef signed int INT;
68 typedef unsigned int UINT;
69 typedef signed long LONG;
70 typedef unsigned long ULONG;
72 typedef signed char INT8;
73 typedef unsigned char UINT8;
74 typedef signed short INT16;
75 typedef unsigned short UINT16;
76 typedef signed long INT32;
77 typedef unsigned long UINT32;
79 typedef double DOUBLE;
80 typedef float FLOAT;
82 typedef char CHAR;
84 typedef UINT8 BOOLEAN;
86 #undef TRUE
87 #define TRUE (BOOLEAN)1
89 #undef FALSE
90 #define FALSE (BOOLEAN)0
92 #undef NULL
93 #ifdef PROTOTYPES
94 # define NULL (VOID *)0
95 #else
96 # define NULL 0L
97 #endif
99 #undef GLOBAL
100 #define GLOBAL
103 /* SPLint */
106 #ifdef S_SPLINT_S
107 #include "splint.h"
108 #endif
111 /* target constants */
113 #ifndef TARGET_OS
114 #define TARGET_OS "unknown"
115 #endif
117 #ifndef TARGET_CPU
118 #define TARGET_CPU "unknown"
119 #endif
121 #ifndef TARGET_VENDOR
122 #define TARGET_VENDOR "unknown"
123 #endif
126 /* configure options */
128 #ifndef HAVE_socklen_t
129 #define socklen_t int /* u.a. fuer Mac OS X */
130 #endif
132 #if OS_UNIX_AUX
133 #define _POSIX_SOURCE /* muss unter A/UX definiert sein */
134 #endif
136 #ifndef HAVE_SNPRINTF
137 EXTERN INT snprintf PARAMS(( CHAR *str, size_t count, CONST CHAR *fmt, ... ));
138 #endif
140 #ifndef HAVE_STRLCAT
141 EXTERN size_t strlcat PARAMS(( CHAR *dst, CONST CHAR *src, size_t size ));
142 #endif
144 #ifndef HAVE_STRLCPY
145 EXTERN size_t strlcpy PARAMS(( CHAR *dst, CONST CHAR *src, size_t size ));
146 #endif
148 #ifndef HAVE_VSNPRINTF
149 EXTERN INT vsnprintf PARAMS(( CHAR *str, size_t count, CONST CHAR *fmt, va_list args ));
150 #endif
153 #endif
156 /* -eof- */