-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[workspace] Improve qhull hidden visibility
When building C++ code, we should not use -fvisibility=hidden because it infects all #included code, even the standard library. This causes a lot of console spam during macOS builds, and is a typeinfo (vtable) problem even on Ubuntu, potentially leading to ODR violation. Instead, we should wrap the third-party C++ code in a inline hidden namespace. That way, only the third-party code itself is hidden, not anything that it #includes.
- Loading branch information
1 parent
a5c310f
commit 3fddbe1
Showing
5 changed files
with
58 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
For private access within the module, don't use out-of-namespace friendship with | ||
an `extern "C"` function. This doesn't work with drake's namespace vendoring. | ||
|
||
Instead, just make the fields public. | ||
|
||
--- src/libqhullcpp/QhullQh.h.orig 2022-03-11 15:34:46.350243223 -0800 | ||
+++ src/libqhullcpp/QhullQh.h 2022-03-11 15:34:33.294070367 -0800 | ||
@@ -58,7 +58,7 @@ | ||
#//!\name Constants | ||
|
||
#//!\name Fields | ||
-private: | ||
+public: | ||
int qhull_status; //!< qh_ERRnone if valid | ||
std::string qhull_message; //!< Returned messages from libqhull_r | ||
std::ostream * error_stream; //!< overrides errorMessage, use appendQhullMessage() | ||
@@ -66,8 +66,9 @@ | ||
double factor_epsilon; //!< Factor to increase ANGLEround and DISTround for hyperplane equality | ||
bool use_output_stream; //!< True if using output_stream | ||
|
||
+private: | ||
//! modified by qh_fprintf in QhullUser.cpp | ||
- friend void ::qh_fprintf(qhT *qh, FILE *fp, int msgcode, const char *fmt, ... ); | ||
+ //friend void ::qh_fprintf(qhT *qh, FILE *fp, int msgcode, const char *fmt, ... ); | ||
|
||
static const double default_factor_epsilon; //!< Default factor_epsilon is 1.0, never updated | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters