minisat: Only define __STDC_XXX_MACROS if not already defined.

Replace;
 #define __STDC_LIMIT_MACROS
 #define __STDC_FORMAT_MACROS

With
 #ifndef __STDC_LIMIT_MACROS
 #define __STDC_LIMIT_MACROS
 #endif
 #ifndef __STDC_FORMAT_MACROS
 #define __STDC_FORMAT_MACROS
 #endif

This fixes a compile warning if you are defining these macros in your
CXXFLAGS (as some distros do).
This commit is contained in:
Tim 'mithro' Ansell 2017-11-24 15:34:46 +11:00
parent 8d48b47450
commit 34c9fbab53
6 changed files with 23 additions and 3 deletions

View File

@ -18,8 +18,12 @@
*/ */
// needed for MiniSAT headers (see Minisat Makefile) // needed for MiniSAT headers (see Minisat Makefile)
#define __STDC_LIMIT_MACROS #ifndef __STDC_FORMAT_MACROS
#define __STDC_FORMAT_MACROS #define __STDC_FORMAT_MACROS
#endif
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS
#endif
#include "ezminisat.h" #include "ezminisat.h"

View File

@ -9,8 +9,8 @@ rm -rf minisat_upstream
sed -i -e 's,^#include *"minisat/[^/]\+/\?,#include ",' *.cc *.h sed -i -e 's,^#include *"minisat/[^/]\+/\?,#include ",' *.cc *.h
sed -i -e 's/Minisat::memUsedPeak()/Minisat::memUsedPeak(bool)/' System.cc sed -i -e 's/Minisat::memUsedPeak()/Minisat::memUsedPeak(bool)/' System.cc
sed -i -e 's/PRI[iu]64/ & /' Options.h Solver.cc sed -i -e 's/PRI[iu]64/ & /' Options.h Solver.cc
sed -i -e '1 i #define __STDC_LIMIT_MACROS' *.cc sed -i -e '1 i #ifndef __STDC_LIMIT_MACROS\n#define __STDC_LIMIT_MACROS\n#endif' *.cc
sed -i -e '1 i #define __STDC_FORMAT_MACROS' *.cc sed -i -e '1 i #ifndef __STDC_FORMAT_MACROS\n#define __STDC_FORMAT_MACROS\n#endif' *.cc
patch -p0 < 00_PATCH_mkLit_default_arg.patch patch -p0 < 00_PATCH_mkLit_default_arg.patch
patch -p0 < 00_PATCH_remove_zlib.patch patch -p0 < 00_PATCH_remove_zlib.patch

View File

@ -1,5 +1,9 @@
#ifndef __STDC_FORMAT_MACROS
#define __STDC_FORMAT_MACROS #define __STDC_FORMAT_MACROS
#endif
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS
#endif
/**************************************************************************************[Options.cc] /**************************************************************************************[Options.cc]
Copyright (c) 2008-2010, Niklas Sorensson Copyright (c) 2008-2010, Niklas Sorensson

View File

@ -1,5 +1,9 @@
#ifndef __STDC_FORMAT_MACROS
#define __STDC_FORMAT_MACROS #define __STDC_FORMAT_MACROS
#endif
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS
#endif
/***********************************************************************************[SimpSolver.cc] /***********************************************************************************[SimpSolver.cc]
Copyright (c) 2006, Niklas Een, Niklas Sorensson Copyright (c) 2006, Niklas Een, Niklas Sorensson
Copyright (c) 2007-2010, Niklas Sorensson Copyright (c) 2007-2010, Niklas Sorensson

View File

@ -1,5 +1,9 @@
#ifndef __STDC_FORMAT_MACROS
#define __STDC_FORMAT_MACROS #define __STDC_FORMAT_MACROS
#endif
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS
#endif
/***************************************************************************************[Solver.cc] /***************************************************************************************[Solver.cc]
Copyright (c) 2003-2006, Niklas Een, Niklas Sorensson Copyright (c) 2003-2006, Niklas Een, Niklas Sorensson
Copyright (c) 2007-2010, Niklas Sorensson Copyright (c) 2007-2010, Niklas Sorensson

View File

@ -1,5 +1,9 @@
#ifndef __STDC_FORMAT_MACROS
#define __STDC_FORMAT_MACROS #define __STDC_FORMAT_MACROS
#endif
#ifndef __STDC_LIMIT_MACROS
#define __STDC_LIMIT_MACROS #define __STDC_LIMIT_MACROS
#endif
/***************************************************************************************[System.cc] /***************************************************************************************[System.cc]
Copyright (c) 2003-2006, Niklas Een, Niklas Sorensson Copyright (c) 2003-2006, Niklas Een, Niklas Sorensson
Copyright (c) 2007-2010, Niklas Sorensson Copyright (c) 2007-2010, Niklas Sorensson