summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2022-03-22 16:12:00 +1300
committerAndreas Schneider <asn@cryptomilk.org>2022-03-23 12:31:47 +0000
commitc0f5af21acb8018a5e53d25f1560d2a96b79a7c0 (patch)
treec86ad31da026e30d83687c0251f125c4d5d89502 /examples
parent1bde388ba854e320a390126155c7aeb60ecfbb90 (diff)
downloadsamba-c0f5af21acb8018a5e53d25f1560d2a96b79a7c0.tar.gz
lib/replace: Do not typedef int bool
We need a genuine boolean type, as otherwise expressions like bool foo = (4 & 4); if (foo == true) { exit(1); } else { exit(2); } could evaluate differently on non-modern platforms, and that would be a real pain to debug. _Bool and bool are in C99 BUG: https://bugzilla.samba.org/show_bug.cgi?id=15028 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Wed Mar 23 12:31:47 UTC 2022 on sn-devel-184
Diffstat (limited to 'examples')
-rw-r--r--examples/perfcounter/perf.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/examples/perfcounter/perf.h b/examples/perfcounter/perf.h
index b2968a08cf7..03b544846c5 100644
--- a/examples/perfcounter/perf.h
+++ b/examples/perfcounter/perf.h
@@ -31,7 +31,7 @@
#ifdef HAVE__Bool
#define bool _Bool
#else
-typedef int bool;
+#error Need a real boolean type
#endif
#endif