]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
tests: sanity-cpp: don't use <minmax.h> from Gnulib
authorDaiki Ueno <ueno@gnu.org>
Fri, 26 Jul 2024 13:35:35 +0000 (22:35 +0900)
committerDaiki Ueno <ueno@gnu.org>
Fri, 26 Jul 2024 14:08:43 +0000 (23:08 +0900)
Adding Gnulib include directory causes some conflict through indirect
include of <pthread.h>. As sanity-cpp.cpp only uses MIN macro, we can
simply define it by ourselves instead of including <minmax.h>.

Signed-off-by: Daiki Ueno <ueno@gnu.org>
tests/Makefile.am
tests/sanity-cpp.cpp

index ca76736d2e21bf7d21e70b2288912e61fe071e48..fa4689619a7dd85bcf5ca83a3e05f2fe0c97c780 100644 (file)
@@ -612,9 +612,7 @@ cpptests += sanity-cpp
 
 sanity_cpp_SOURCES = sanity-cpp.cpp
 sanity_cpp_LDADD = $(CMOCKA_LDADD)
-sanity_cpp_CXXFLAGS = $(AM_CPPFLAGS) \
-       -I$(top_srcdir)/gl      \
-       -I$(top_builddir)/gl
+sanity_cpp_CXXFLAGS = $(AM_CPPFLAGS) $(CMOCKA_CFLAGS)
 endif
 endif
 
index bb352a1e3a2efe2167ded3264f5334adfebe3f8e..6acbc3b263cff6edad1876b4569b7c4d54c4c381 100644 (file)
@@ -36,7 +36,8 @@ extern "C" {
 #include "cert-common.h"
 #include <setjmp.h>
 #include <cmocka.h>
-#include <minmax.h>
+#undef MIN
+#define MIN(x,y) (x > y ? y : x)
 }
 
 /* This is a basic test for C++ API */