2 d18ca0b8 2002-03-12 alex * ngIRCd -- The Next Generation IRC Daemon
3 d18ca0b8 2002-03-12 alex * Copyright (c)2001,2002 by 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 c9540015 2003-01-03 alex * $Id: portab.h,v 1.12 2003/01/03 22:03:51 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 4f6f84e7 2002-12-26 alex #ifdef HAVE_SYS_TYPES_H
24 4f6f84e7 2002-12-26 alex #include <sys/types.h>
28 e13cb291 2002-12-26 alex /* compiler features */
30 6725d789 2002-12-12 alex #ifdef __GNUC__
31 6725d789 2002-12-12 alex # define PUNUSED(x) __attribute__ ((unused)) x
32 6725d789 2002-12-12 alex # define UNUSED __attribute__ ((unused))
34 6725d789 2002-12-12 alex # define PUNUSED(x) x
35 6725d789 2002-12-12 alex # define UNUSED
38 ba258e65 2002-05-27 alex #ifndef PARAMS
39 ba258e65 2002-05-27 alex # if PROTOTYPES
40 ba258e65 2002-05-27 alex # define PARAMS(args) args
42 ba258e65 2002-05-27 alex # define PARAMS(args) ()
47 e13cb291 2002-12-26 alex /* keywords */
49 d18ca0b8 2002-03-12 alex #define EXTERN extern
50 d18ca0b8 2002-03-12 alex #define STATIC static
51 d18ca0b8 2002-03-12 alex #define LOCAL static
52 d18ca0b8 2002-03-12 alex #define CONST const
53 cf9629b9 2002-06-26 alex #define REGISTER register
56 e13cb291 2002-12-26 alex /* datatypes */
58 ba258e65 2002-05-27 alex #ifndef PROTOTYPES
59 ba258e65 2002-05-27 alex # ifndef signed
60 ba258e65 2002-05-27 alex # define signed
64 d18ca0b8 2002-03-12 alex typedef void VOID;
65 d18ca0b8 2002-03-12 alex typedef void POINTER;
67 d18ca0b8 2002-03-12 alex typedef signed int INT;
68 d18ca0b8 2002-03-12 alex typedef unsigned int UINT;
69 84022a12 2002-10-09 alex typedef signed long LONG;
70 84022a12 2002-10-09 alex typedef unsigned long ULONG;
72 d18ca0b8 2002-03-12 alex typedef signed char INT8;
73 d18ca0b8 2002-03-12 alex typedef unsigned char UINT8;
74 d18ca0b8 2002-03-12 alex typedef signed short INT16;
75 d18ca0b8 2002-03-12 alex typedef unsigned short UINT16;
76 d18ca0b8 2002-03-12 alex typedef signed long INT32;
77 d18ca0b8 2002-03-12 alex typedef unsigned long UINT32;
79 84022a12 2002-10-09 alex typedef double DOUBLE;
80 d18ca0b8 2002-03-12 alex typedef float FLOAT;
82 d18ca0b8 2002-03-12 alex typedef char CHAR;
84 d18ca0b8 2002-03-12 alex typedef UINT8 BOOLEAN;
87 d18ca0b8 2002-03-12 alex #define TRUE (BOOLEAN)1
89 d18ca0b8 2002-03-12 alex #undef FALSE
90 d18ca0b8 2002-03-12 alex #define FALSE (BOOLEAN)0
93 ba258e65 2002-05-27 alex #ifdef PROTOTYPES
94 ba258e65 2002-05-27 alex # define NULL (VOID *)0
96 ba258e65 2002-05-27 alex # define NULL 0L
99 d18ca0b8 2002-03-12 alex #undef GLOBAL
100 d18ca0b8 2002-03-12 alex #define GLOBAL
103 8d79f267 2002-03-25 alex /* SPLint */
106 8d79f267 2002-03-25 alex #ifdef S_SPLINT_S
107 8d79f267 2002-03-25 alex #include "splint.h"
111 e13cb291 2002-12-26 alex /* target constants */
113 e13cb291 2002-12-26 alex #ifndef TARGET_OS
114 e13cb291 2002-12-26 alex #define TARGET_OS "unknown"
117 e13cb291 2002-12-26 alex #ifndef TARGET_CPU
118 e13cb291 2002-12-26 alex #define TARGET_CPU "unknown"
121 e13cb291 2002-12-26 alex #ifndef TARGET_VENDOR
122 e13cb291 2002-12-26 alex #define TARGET_VENDOR "unknown"
126 e13cb291 2002-12-26 alex /* configure options */
128 d18ca0b8 2002-03-12 alex #ifndef HAVE_socklen_t
129 d18ca0b8 2002-03-12 alex #define socklen_t int /* u.a. fuer Mac OS X */
132 d18ca0b8 2002-03-12 alex #if OS_UNIX_AUX
133 d18ca0b8 2002-03-12 alex #define _POSIX_SOURCE /* muss unter A/UX definiert sein */
136 e13cb291 2002-12-26 alex #ifndef HAVE_SNPRINTF
137 c9540015 2003-01-03 alex EXTERN INT snprintf PARAMS(( CHAR *str, size_t count, CONST CHAR *fmt, ... ));
140 e13cb291 2002-12-26 alex #ifndef HAVE_STRLCAT
141 c9540015 2003-01-03 alex EXTERN size_t strlcat PARAMS(( CHAR *dst, CONST CHAR *src, size_t size ));
144 e13cb291 2002-12-26 alex #ifndef HAVE_STRLCPY
145 c9540015 2003-01-03 alex EXTERN size_t strlcpy PARAMS(( CHAR *dst, CONST CHAR *src, size_t size ));
148 e13cb291 2002-12-26 alex #ifndef HAVE_VSNPRINTF
149 c9540015 2003-01-03 alex EXTERN INT vsnprintf PARAMS(( CHAR *str, size_t count, CONST CHAR *fmt, va_list args ));
156 d18ca0b8 2002-03-12 alex /* -eof- */