From ce18a7896bbeca45cf0e44953d5901a6417a3252 Mon Sep 17 00:00:00 2001 From: Alexandre Duret-Lutz Date: Tue, 16 Nov 2021 23:25:13 +0100 Subject: [PATCH] Work around issue with inttypes.h macros * python/Makefile.am: Define __STDC_FORMAT_MACROS. --- python/Makefile.am | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/python/Makefile.am b/python/Makefile.am index bd4219164..bab25349c 100644 --- a/python/Makefile.am +++ b/python/Makefile.am @@ -22,8 +22,19 @@ AUTOMAKE_OPTIONS = subdir-objects +# __STDC_FORMAT_MACROS is used to avoid an issue with some version of +# and . Some version of inttypes.h do not +# define macros such as PRIx64 in C++ unless __STDC_FORMAT_MACROS is +# defined. Including will force the definition of +# __STDC_FORMAT_MACROS before including , but if the later +# had already been included before (for instance via the inclusion of +# ), it is too late and the PRIx64 will not be defined. +# This issue has been observed on the CentOS6-based build system used +# by conda-forge; it seems to be fixed in more recent distributions, +# where define PRIx64 and friends unconditionally. AM_CPPFLAGS = -I$(PYTHONINC) -I$(top_builddir) -I$(top_srcdir) \ - $(BUDDY_CPPFLAGS) -lpthread -DSWIG_TYPE_TABLE=spot + $(BUDDY_CPPFLAGS) -lpthread -DSWIG_TYPE_TABLE=spot \ + -D__STDC_FORMAT_MACROS SWIGFLAGS = -c++ -python -py3 -O -MD