From afa49d340c0f3729fcfe6abdc3746a35f40b1770 Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Mon, 14 Oct 2013 17:15:50 -0700 Subject: [PATCH] Add stdbool.h for old MSVC. --- src/libsodium/Makefile.am | 3 +++ src/libsodium/quirks/windows/stdbool.h | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+) create mode 100644 src/libsodium/quirks/windows/stdbool.h diff --git a/src/libsodium/Makefile.am b/src/libsodium/Makefile.am index 3cbb376e..6769fbca 100644 --- a/src/libsodium/Makefile.am +++ b/src/libsodium/Makefile.am @@ -228,3 +228,6 @@ endif SUBDIRS = \ include + +EXTRA_DIST = \ + quirks/windows/stdbool.h diff --git a/src/libsodium/quirks/windows/stdbool.h b/src/libsodium/quirks/windows/stdbool.h new file mode 100644 index 00000000..86e5b7ba --- /dev/null +++ b/src/libsodium/quirks/windows/stdbool.h @@ -0,0 +1,18 @@ + +#ifndef __STDBOOL_H__ +#define __STDBOOL_H__ + +#if defined(__cplusplus) || !defined(__STDC_VERSION__) || __STDC_VERSION__ < 199901L +typedef signed char _Bool; +# undef bool +# define bool _Bool + +# ifndef __bool_true_false_are_defined +# undef false +# define false 0 +# undef true +# define true 1 +# endif +#endif + +#endif