-
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] Clean up NLopt vendoring patches
Rename "vendoring.patch" to the more Drake-conventional "vendor.patch". Instead of patching "extern 'C'" into the external code, adjust the BUILD file to distinguish between C++ code and C code and only run the vendor_cxx tool on C++ code.
- Loading branch information
1 parent
99356ad
commit 2be33a5
Showing
5 changed files
with
144 additions
and
89 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
[nlopt] Use the anonymous namespace for a file-local class | ||
|
||
This is filed as https://github.com/stevengj/nlopt/pull/535 upstream. | ||
|
||
--- src/algs/stogo/stogo.cc | ||
+++ src/algs/stogo/stogo.cc | ||
@@ -4,6 +4,7 @@ | ||
#include "stogo.h" | ||
#include "global.h" | ||
|
||
+namespace { | ||
class MyGlobal : public Global { | ||
protected: | ||
objective_func my_func; | ||
@@ -25,6 +26,7 @@ | ||
return 0.0; | ||
} | ||
}; | ||
+} // namespace | ||
|
||
int stogo_minimize(int n, | ||
objective_func fgrad, void *data, |
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,21 @@ | ||
[nlopt] Adjust the code for vendor_cxx compatibility | ||
|
||
When weaving the inline namespace into this file, we need to ensure that | ||
it doesn't cross an `#if 0` block. | ||
|
||
--- src/algs/stogo/local.cc | ||
+++ src/algs/stogo/local.cc | ||
@@ -11,11 +11,12 @@ | ||
#include "local.h" | ||
#include "tools.h" | ||
|
||
+typedef struct {} force_the_drake_inline_namespace_to_appear_here; | ||
+ | ||
//////////////////////////////////////////////////////////////////////// | ||
// SGJ, 2007: allow local to use local optimizers in NLopt, to compare | ||
// to the BFGS code below | ||
#if 0 | ||
-#include "nlopt.h" | ||
|
||
typedef struct { | ||
Global *glob; |
This file was deleted.
Oops, something went wrong.
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