Blame


1 d18ca0b8 2002-03-12 alex /*
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)
4 d18ca0b8 2002-03-12 alex *
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.
10 d18ca0b8 2002-03-12 alex *
11 f0d633b5 2002-12-12 alex * test program for portab.h and friends ;-)
12 d18ca0b8 2002-03-12 alex */
13 d18ca0b8 2002-03-12 alex
14 d18ca0b8 2002-03-12 alex
15 d18ca0b8 2002-03-12 alex #include "portab.h"
16 d18ca0b8 2002-03-12 alex
17 444fdcf9 2003-01-04 alex static char UNUSED id[] = "$Id: portabtest.c,v 1.11 2003/01/04 10:40:01 alex Exp $";
18 f0d633b5 2002-12-12 alex
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>
24 d18ca0b8 2002-03-12 alex
25 d18ca0b8 2002-03-12 alex #include "exp.h"
26 d18ca0b8 2002-03-12 alex
27 d18ca0b8 2002-03-12 alex
28 5efd0987 2002-12-26 alex LOCAL VOID Panic PARAMS (( CHAR *Reason, INT Code ));
29 5efd0987 2002-12-26 alex
30 5efd0987 2002-12-26 alex
31 ba258e65 2002-05-27 alex GLOBAL int
32 ba258e65 2002-05-27 alex main( VOID )
33 d18ca0b8 2002-03-12 alex {
34 5efd0987 2002-12-26 alex /* validate datatypes */
35 5efd0987 2002-12-26 alex if( FALSE != 0 ) Panic( "FALSE", 1 );
36 5efd0987 2002-12-26 alex if( TRUE != 1 ) Panic( "TRUE", 1 );
37 5efd0987 2002-12-26 alex if( sizeof( INT8 ) != 1 ) Panic( "INT8", 1 );
38 5efd0987 2002-12-26 alex if( sizeof( UINT8 ) != 1 ) Panic( "UINT8", 1 );
39 5efd0987 2002-12-26 alex if( sizeof( INT16 ) != 2 ) Panic( "INT16", 1 );
40 5efd0987 2002-12-26 alex if( sizeof( UINT16 ) != 2 ) Panic( "UINT16", 1 );
41 5efd0987 2002-12-26 alex if( sizeof( INT32 ) != 4 ) Panic( "INT32", 1 );
42 5efd0987 2002-12-26 alex if( sizeof( UINT32 ) != 4 ) Panic( "UINT32", 1 );
43 5efd0987 2002-12-26 alex
44 444fdcf9 2003-01-04 alex #ifdef PROTOTYPES
45 5efd0987 2002-12-26 alex /* check functions */
46 5efd0987 2002-12-26 alex if( ! snprintf ) Panic( "snprintf", 2 );
47 5efd0987 2002-12-26 alex if( ! vsnprintf ) Panic( "vsnprintf", 2 );
48 5efd0987 2002-12-26 alex if( ! strlcpy ) Panic( "strlcpy", 2 );
49 5efd0987 2002-12-26 alex if( ! strlcat ) Panic( "strlcat", 2 );
50 444fdcf9 2003-01-04 alex #endif
51 dd4535b7 2002-09-09 alex
52 5efd0987 2002-12-26 alex /* ok, no error */
53 dd4535b7 2002-09-09 alex return 0;
54 d18ca0b8 2002-03-12 alex } /* portab_check_types */
55 d18ca0b8 2002-03-12 alex
56 d18ca0b8 2002-03-12 alex
57 5efd0987 2002-12-26 alex LOCAL VOID
58 5efd0987 2002-12-26 alex Panic( CHAR *Reason, INT Code )
59 5efd0987 2002-12-26 alex {
60 5efd0987 2002-12-26 alex /* Oops, something failed!? */
61 5efd0987 2002-12-26 alex fprintf( stderr, "Oops, test for %s failed!?", Reason );
62 5efd0987 2002-12-26 alex exit( Code );
63 5efd0987 2002-12-26 alex } /* Panic */
64 5efd0987 2002-12-26 alex
65 5efd0987 2002-12-26 alex
66 d18ca0b8 2002-03-12 alex /* -eof- */