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 77f54693 2005-07-31 alex static char UNUSED id[] = "$Id: portabtest.c,v 1.13 2005/07/31 20:13:11 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 77f54693 2005-07-31 alex static 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 8adff592 2005-03-19 fw main( void )
33 d18ca0b8 2002-03-12 alex {
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 );
40 5efd0987 2002-12-26 alex
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 );
47 444fdcf9 2003-01-04 alex #endif
48 dd4535b7 2002-09-09 alex
49 5efd0987 2002-12-26 alex /* ok, no error */
50 dd4535b7 2002-09-09 alex return 0;
51 d18ca0b8 2002-03-12 alex } /* portab_check_types */
52 d18ca0b8 2002-03-12 alex
53 d18ca0b8 2002-03-12 alex
54 77f54693 2005-07-31 alex static void
55 8adff592 2005-03-19 fw Panic( char *Reason, int Code )
56 5efd0987 2002-12-26 alex {
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 */
61 5efd0987 2002-12-26 alex
62 5efd0987 2002-12-26 alex
63 d18ca0b8 2002-03-12 alex /* -eof- */