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 f0d633b5 2002-12-12 alex * This program is free software; you can redistribute it and/or modify
6 f0d633b5 2002-12-12 alex * it under the terms of the GNU General Public License as published by
7 f0d633b5 2002-12-12 alex * the Free Software Foundation; either version 2 of the License, or
8 f0d633b5 2002-12-12 alex * (at your option) any later version.
9 f0d633b5 2002-12-12 alex * Please read the file COPYING, README and AUTHORS for more information.
11 f0d633b5 2002-12-12 alex * test program for portab.h and friends ;-)
15 d18ca0b8 2002-03-12 alex #include "portab.h"
17 77f54693 2005-07-31 alex static char UNUSED id[] = "$Id: portabtest.c,v 1.13 2005/07/31 20:13:11 alex Exp $";
19 d18ca0b8 2002-03-12 alex #include "imp.h"
20 5efd0987 2002-12-26 alex #include <stdarg.h>
21 d18ca0b8 2002-03-12 alex #include <stdio.h>
22 5efd0987 2002-12-26 alex #include <stdlib.h>
23 5efd0987 2002-12-26 alex #include <string.h>
25 d18ca0b8 2002-03-12 alex #include "exp.h"
28 77f54693 2005-07-31 alex static void Panic PARAMS (( char *Reason, int Code ));
34 5efd0987 2002-12-26 alex /* validate datatypes */
35 8adff592 2005-03-19 fw if( false != 0 ) Panic( "false", 1 );
36 8adff592 2005-03-19 fw if( true != 1 ) Panic( "true", 1 );
37 5efd0987 2002-12-26 alex if( sizeof( UINT8 ) != 1 ) Panic( "UINT8", 1 );
38 5efd0987 2002-12-26 alex if( sizeof( UINT16 ) != 2 ) Panic( "UINT16", 1 );
39 5efd0987 2002-12-26 alex if( sizeof( UINT32 ) != 4 ) Panic( "UINT32", 1 );
41 444fdcf9 2003-01-04 alex #ifdef PROTOTYPES
42 5efd0987 2002-12-26 alex /* check functions */
43 5efd0987 2002-12-26 alex if( ! snprintf ) Panic( "snprintf", 2 );
44 5efd0987 2002-12-26 alex if( ! vsnprintf ) Panic( "vsnprintf", 2 );
45 5efd0987 2002-12-26 alex if( ! strlcpy ) Panic( "strlcpy", 2 );
46 5efd0987 2002-12-26 alex if( ! strlcat ) Panic( "strlcat", 2 );
49 5efd0987 2002-12-26 alex /* ok, no error */
51 d18ca0b8 2002-03-12 alex } /* portab_check_types */
55 8adff592 2005-03-19 fw Panic( char *Reason, int Code )
57 5efd0987 2002-12-26 alex /* Oops, something failed!? */
58 5efd0987 2002-12-26 alex fprintf( stderr, "Oops, test for %s failed!?", Reason );
59 5efd0987 2002-12-26 alex exit( Code );
60 5efd0987 2002-12-26 alex } /* Panic */