improve NetBSD-specific code
NetBSD doesn't put packages in /usr/local like /CMakeLists.txt thought. The `#ifdef __NetBSD__` around iconv was actually breaking compilation on NetBSD when using the system libiconv (there's also a GNU iconv package) A C program included from C++ source broke on NetBSD specifically, work around it. This doesn't fix compilation on NetBSD, which is currently broken, but is closer to correct.
This commit is contained in:
3 files changed
+12
-9
No files matched your search
@@ -11,6 +11,17 @@
|
||||
#include <string_view>
|
||||
#include <utility>
|
||||
|
||||
// https://github.com/zserge/expr/ is a C program and sorta valid C++.
|
||||
// When included in a C++ program, it's treated as a C++ code, and it may cause
|
||||
// issues: <cmath> may already be included, if so, including <math.h> may
|
||||
// not do anything. <math.h> is obligated to put its functions in the global
|
||||
// namespace, while <cmath> may or may not. The C code we're interpreting as
|
||||
// C++ won't call functions by their qualified names. The code may work anyway
|
||||
// if <cmath> puts its functions in the global namespace, or if the functions
|
||||
// are actually macros that expand inline, both of which are common.
|
||||
// NetBSD 10.0 i386 is an exception, and we need `using` there.
|
||||
using std::isinf;
|
||||
using std::isnan;
|
||||
#include <expr.h>
|
||||
|
||||
#include "Common/BitUtils.h"
|
||||
|
||||
Reference in new issue
Block a user