]> andersk Git - splint.git/blame - src/Headers/bool.h
Making fixes for Microsoft Visual C++ compiler.
[splint.git] / src / Headers / bool.h
CommitLineData
885824d3 1/*
c0de361f 2** Copyright (C) University of Virginia, Massachusetts Institue of Technology 1994-2003.
885824d3 3** See ../LICENSE for license information.
4**
5*/
6# if !defined(BOOL_H)
7
8# define BOOL_H
9
4caf866b 10# ifdef WIN32
11# ifndef FALSE
12/*@constant bool FALSE=false@*/
13# define FALSE 0
14# endif
15
16# ifndef TRUE
17/*@constant bool TRUE=true@*/
18# define TRUE (!FALSE)
19# endif
20# else
885824d3 21# ifndef FALSE
0bd4c301 22/*@constant bool FALSE=false@*/
23# define FALSE false
885824d3 24# endif
25
26# ifndef TRUE
0bd4c301 27/*@constant bool TRUE=true@*/
28# define TRUE true
885824d3 29# endif
4caf866b 30# endif
885824d3 31
32extern /*@observer@*/ cstring bool_unparse (bool p_b) /*@*/ ;
33extern /*@observer@*/ cstring bool_dump (bool p_b) /*@*/ ;
34extern /*@unused@*/ bool bool_not (bool p_b) /*@*/ ;
35extern bool bool_equal (bool p_b1, bool p_b2) /*@*/ ;
36extern int bool_compare (bool p_b1, bool p_b2) /*@*/ ;
37extern bool bool_fromInt (int p_i) /*@*/ ;
38extern int bool_toInt (bool p_b) /*@*/ ;
39
6483a926 40extern bool bool_isReasonable (/*@sef@*/ bool p_b) /*@*/ ;
41/*@-boolcompare@*/
42# define bool_isReasonable(b) (((b) == TRUE) || ((b) == FALSE))
43/*@=boolcompare@*/
44
885824d3 45# define bool_unparse(b) (cstring_makeLiteralTemp ((b) ? "true" : "false" ))
46# define bool_dump(b) (cstring_makeLiteralTemp ((b) ? "1" : "0" ))
47# define bool_not(b) ((b) ? FALSE : TRUE)
48# define bool_equal(a,b) ((a) ? (b) : !(b))
49# define bool_compare(a,b) ((a) ? ((b) ? 0 : 1) : ((b) ? -1 : 0))
50# define bool_fromInt(i) (((i) != 0) ? TRUE : FALSE)
51# define bool_toInt(b) ((b) ? 1 : 0)
52
53# else
54# error "Multiple include"
55# endif
56
57
58
59
This page took 0.084677 seconds and 5 git commands to generate.