Skip to content

Commit 6b435f5

Browse files
authored
Merge pull request #2327 from zedalaye/fix-msvc-2022
Fix to make czmq/zyre build in MSVC 2022 when C version is <23
2 parents f22f657 + a3f5e7b commit 6b435f5

1 file changed

Lines changed: 9 additions & 8 deletions

File tree

include/czmq_prelude.h

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -530,15 +530,16 @@ typedef struct {
530530

531531

532532
// Fallback for booleans for pre-C23 C and MSVC builds
533-
#if defined(__STDC_VERSION__) && __STDC_VERSION__ < 202311L
534-
# if (defined (_MSC_VER))
535-
# if (!defined (__cplusplus) && (!defined (true)))
536-
# define true 1
537-
# define false 0
538-
typedef char bool;
539-
# endif
533+
#if !defined(__cplusplus) && !defined(__bool_true_false_are_defined)
534+
# if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L
535+
# include <stdbool.h>
536+
# elif defined(_MSC_VER)
537+
typedef char bool;
538+
# define true 1
539+
# define false 0
540+
# define __bool_true_false_are_defined 1
540541
# else
541-
# include <stdbool.h>
542+
# include <stdbool.h>
542543
# endif
543544
#endif
544545

0 commit comments

Comments
 (0)