-
Notifications
You must be signed in to change notification settings - Fork 36
Export symbols in Windows DLL #213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Export symbols in Windows DLL #213
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
| /// passed as a parameter, and if the parent is not passed, | ||
| /// then global scope will be assumed. | ||
| TCppScope_t GetScope(const std::string &name, TCppScope_t parent = 0); | ||
| DllExport TCppScope_t GetScope(const std::string &name, TCppScope_t parent = 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: use nullptr [modernize-use-nullptr]
| DllExport TCppScope_t GetScope(const std::string &name, TCppScope_t parent = 0); | |
| DllExport TCppScope_t GetScope(const std::string &name, TCppScope_t parent = nullptr); |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #213 +/- ##
=======================================
Coverage 78.74% 78.74%
=======================================
Files 8 8
Lines 3091 3091
=======================================
Hits 2434 2434
Misses 657 657
|
| #ifdef _WIN32 | ||
| #define DllExport __declspec(dllexport) | ||
| #else | ||
| #define DllExport __attribute__((visibility("default"))) | ||
| #endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| #ifdef _WIN32 | |
| #define DllExport __declspec(dllexport) | |
| #else | |
| #define DllExport __attribute__((visibility("default"))) | |
| #endif | |
| #ifdef _WIN32 | |
| #define CPPINTEROP_API __declspec(dllexport) | |
| #else | |
| #define CPPINTEROP_API __attribute__((visibility("default"))) | |
| #endif |
It's probably better name.
| /// can be used to iterate through the index value to get each specific | ||
| /// base class. | ||
| TCppScope_t GetBaseClass(TCppType_t klass, TCppIndex_t ibase); | ||
| DllExport DllExport TCppScope_t GetBaseClass(TCppType_t klass, TCppIndex_t ibase); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| DllExport DllExport TCppScope_t GetBaseClass(TCppType_t klass, TCppIndex_t ibase); | |
| DllExport TCppScope_t GetBaseClass(TCppType_t klass, TCppIndex_t ibase); |
|
|
||
| /// Ends recording the standard stream and returns the result as a string. | ||
| std::string EndStdStreamCapture(); | ||
| DllExport std::string EndStdStreamCapture(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| DllExport std::string EndStdStreamCapture(); | |
| DllExport std::string EndStdStreamCapture(); | |
| #undef CPPINTEROP_API |
lib/Interpreter/CppInterOp.cpp
Outdated
| // End of JitCall Helper Functions | ||
|
|
||
| JitCall MakeFunctionCallable(TCppConstFunction_t func) { | ||
| DllExport JitCall MakeFunctionCallable(TCppConstFunction_t func) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not need to export things outside of the public API that's defined in the header file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
| /// passed as a parameter, and if the parent is not passed, | ||
| /// then global scope will be assumed. | ||
| TCppScope_t GetScope(const std::string &name, TCppScope_t parent = 0); | ||
| CPPINTEROP_API TCppScope_t GetScope(const std::string &name, TCppScope_t parent = 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: use nullptr [modernize-use-nullptr]
| CPPINTEROP_API TCppScope_t GetScope(const std::string &name, TCppScope_t parent = 0); | |
| CPPINTEROP_API TCppScope_t GetScope(const std::string &name, TCppScope_t parent = nullptr); |
lib/Interpreter/CppInterOp.cpp
Outdated
| // End of JitCall Helper Functions | ||
|
|
||
| JitCall MakeFunctionCallable(TCppConstFunction_t func) { | ||
| DllExport JitCall MakeFunctionCallable(TCppConstFunction_t func) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: variable 'JitCall' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]
DllExport JitCall MakeFunctionCallable(TCppConstFunction_t func) {
^9ddad94 to
310d7c3
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clang-tidy made some suggestions
| /// then global scope will be assumed. | ||
| TCppScope_t GetScope(const std::string &name, TCppScope_t parent = 0); | ||
| CPPINTEROP_API TCppScope_t GetScope(const std::string& name, | ||
| TCppScope_t parent = 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: use nullptr [modernize-use-nullptr]
| TCppScope_t parent = 0); | |
| TCppScope_t parent = nullptr); |
| bool ExistsFunctionTemplate(const std::string& name, | ||
| TCppScope_t parent = 0); | ||
| CPPINTEROP_API bool ExistsFunctionTemplate(const std::string& name, | ||
| TCppScope_t parent = 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
warning: use nullptr [modernize-use-nullptr]
| TCppScope_t parent = 0); | |
| TCppScope_t parent = nullptr); |
vgvassilev
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
No description provided.