Skip to content

Add minor fixes for cross-platform support #301

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

Merged
merged 2 commits into from
May 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions include/clang/Interpreter/CppInterOp.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,14 @@
#include <vector>

// The cross-platform CPPINTEROP_API macro definition
#ifdef _WIN32
#if defined _WIN32 || defined __CYGWIN__
#define CPPINTEROP_API __declspec(dllexport)
#else
#define CPPINTEROP_API __attribute__((visibility("default")))
#ifdef __GNUC__
#define CPPINTEROP_API __attribute__((__visibility__("default")))
#else
#define CPPINTEROP_API
#endif
#endif

namespace Cpp {
Expand Down Expand Up @@ -272,8 +276,7 @@ namespace Cpp {
/// is used to get the number of Base Classes, and then that number
/// can be used to iterate through the index value to get each specific
/// base class.
CPPINTEROP_API CPPINTEROP_API TCppScope_t GetBaseClass(TCppType_t klass,
TCppIndex_t ibase);
CPPINTEROP_API TCppScope_t GetBaseClass(TCppType_t klass, TCppIndex_t ibase);

/// Checks if the supplied Derived Class is a sub-class of the
/// provided Base Class.
Expand Down Expand Up @@ -518,7 +521,7 @@ namespace Cpp {

/// Looks up the library if access is enabled.
///\returns the path to the library.
std::string LookupLibrary(const char* lib_name);
CPPINTEROP_API std::string LookupLibrary(const char* lib_name);

/// Finds \c lib_stem considering the list of search paths and loads it by
/// calling dlopen.
Expand Down
Loading