Comments (3)
Ah, that's a bit sad. I added all three in 8effd9c.
Thanks for reporting this, and thanks for maintaining the Corrade/Magnum packages as well :)
from corrade.
Hmm, that's strange, because I have a preprocessor branch that is attempting to select the right variant:
corrade/src/Corrade/Utility/Implementation/ErrorString.cpp
Lines 63 to 69 in 3bf6057
Man pages tell me that _POSIX_C_SOURCE >= 200112L) && !_GNU_SOURCE
is the expression to check, but maybe _POSIX_C_SOURCE
isn't defined by BSD implicitly? (I have to admit my knowledge is very sparse in this area. ๐
) To be clear, I didn't want to #define _POSIX_C_SOURCE
myself to any value to prevent unexpected ABI issues, just wanted to detect which function is actually available.
So, given that I already have to check for Apple and Emscripten explicitly anyway, should I check for BSD this way as well? I.e., would the following work? Is BSD
the right define that covers FreeBSD, OpenBSD and others?
diff --git a/src/Corrade/Utility/Implementation/ErrorString.cpp b/src/Corrade/Utility/Implementation/ErrorString.cpp
index 675a6a9e3..66743901f 100644
--- a/src/Corrade/Utility/Implementation/ErrorString.cpp
+++ b/src/Corrade/Utility/Implementation/ErrorString.cpp
@@ -60,7 +60,7 @@ void printErrnoErrorString(Debug& debug, const int error) {
idea. The POSIX variant returns int(0) on success, while the GNU variant
may return a pointer to a statically allocated string instead of filling
the buffer. Sigh. */
- #if ((_POSIX_C_SOURCE >= 200112L) && !_GNU_SOURCE) || defined(CORRADE_TARGET_EMSCRIPTEN) || defined(CORRADE_TARGET_APPLE)
+ #if ((_POSIX_C_SOURCE >= 200112L) && !_GNU_SOURCE) || defined(CORRADE_TARGET_EMSCRIPTEN) || defined(CORRADE_TARGET_APPLE) || defined(BSD)
char string[256];
CORRADE_INTERNAL_ASSERT_OUTPUT(strerror_r(error, string, Containers::arraySize(string)) == 0);
#else
Thanks in advance for testing this patch!
from corrade.
The patch doesn't work, but it works when defined (__FreeBSD__)
is used.
I just verified - no generic BSD define is present in the C++ compiler on FreeBSD:
$ c++ -dM -E - < /usr/include/time.h | grep -i BSD
#define __BSD_VISIBLE 1
#define __FBSDID(s) __IDSTRING(__CONCAT(__rcsid_,__LINE__),s)
#define __FreeBSD__ 13
#define __FreeBSD_cc_version 1300010
#define __VERSION__ "FreeBSD Clang 14.0.5 (https://github.com/llvm/llvm-project.git llvmorg-14.0.5-0-gc12386ae247c)"
Only the __FreeBSD__
is usable.
Likewise, __OpenBSD__
and __NetBSD__
are defined on those systems.
from corrade.
Related Issues (20)
- Corrade's test suite fails under AddressSanitizer HOT 9
- Corrade with BUILD_TESTS=ON compilation error: call to non-โconstexprโ function HOT 5
- Error when installing via HunterGate HOT 7
- Prefix cmake options with CORRADE_ HOT 4
- Windows: inconsistent redefinition of _aligned_malloc HOT 3
- Corrade adds /wd*** warning disablements to "clang.exe" on windows. HOT 1
- Building Corrade with -std=c++20 causes errors inside MinGW <numbers> header HOT 3
- Corrade fails to compile with emscripten 3.1.22 HOT 4
- Opt-in to native UTF-8 support for OS interaction on Windows
- std::tuple_size / tuple_element specializations for Corrade containers HOT 1
- Optimizing compilation time for the test suite -- an analysis HOT 3
- Interconnect - Slots are not called according to their record order HOT 1
- V8::Zone Allocator HOT 1
- NEON code does not build on armv7 HOT 2
- what to set CORRADE_INCLUDE_DIR to for in-source-builds HOT 2
- JsonToken::asObject() odd behavior with empty objects HOT 2
- New Release HOT 1
- Broken Interconnect on Clang-CL 16.0.5 HOT 9
- Packaging location of GDB script files HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from corrade.