2 * ngIRCd -- The Next Generation IRC Daemon
3 * Copyright (c)2001,2002 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 * test program for portab.h and friends ;-)
17 static char UNUSED id[] = "$Id: portabtest.c,v 1.11 2003/01/04 10:40:01 alex Exp $";
28 LOCAL VOID Panic PARAMS (( CHAR *Reason, INT Code ));
34 /* validate datatypes */
35 if( FALSE != 0 ) Panic( "FALSE", 1 );
36 if( TRUE != 1 ) Panic( "TRUE", 1 );
37 if( sizeof( INT8 ) != 1 ) Panic( "INT8", 1 );
38 if( sizeof( UINT8 ) != 1 ) Panic( "UINT8", 1 );
39 if( sizeof( INT16 ) != 2 ) Panic( "INT16", 1 );
40 if( sizeof( UINT16 ) != 2 ) Panic( "UINT16", 1 );
41 if( sizeof( INT32 ) != 4 ) Panic( "INT32", 1 );
42 if( sizeof( UINT32 ) != 4 ) Panic( "UINT32", 1 );
46 if( ! snprintf ) Panic( "snprintf", 2 );
47 if( ! vsnprintf ) Panic( "vsnprintf", 2 );
48 if( ! strlcpy ) Panic( "strlcpy", 2 );
49 if( ! strlcat ) Panic( "strlcat", 2 );
54 } /* portab_check_types */
58 Panic( CHAR *Reason, INT Code )
60 /* Oops, something failed!? */
61 fprintf( stderr, "Oops, test for %s failed!?", Reason );