Skip to content
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

build(c): adjust ADBC_EXPORT work on msys #2356

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion c/driver/sqlite/statement_reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ extern "C" {
#endif

/// \brief Helper to manage binding data to a SQLite statement.
struct ADBC_EXPORT AdbcSqliteBinder {
struct ADBC_EXPORT_STRUCT AdbcSqliteBinder {
// State
struct ArrowSchema schema;
struct ArrowArrayStream params;
Expand Down
41 changes: 26 additions & 15 deletions c/include/arrow-adbc/adbc.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,26 @@ struct ArrowArrayStream {
// Storage class macros for Windows
// Allow overriding/aliasing with application-defined macros
#if !defined(ADBC_EXPORT)
#if defined(_WIN32)
#if defined(ADBC_EXPORTING)
#define ADBC_EXPORT __declspec(dllexport)
#else
#define ADBC_EXPORT __declspec(dllimport)
#endif // defined(ADBC_EXPORTING)
#else
#define ADBC_EXPORT
#endif // defined(_WIN32)
#if defined(_WIN32)
#if defined(ADBC_EXPORTING)
#define ADBC_EXPORT __declspec(dllexport)
#else
#define ADBC_EXPORT __declspec(dllimport)
#endif // defined(ADBC_EXPORTING)

#if defined(__cplusplus)
#if defined(ADBC_EXPORTING)
#define ADBC_EXPORT_STRUCT __declspec(dllexport)
#else
#define ADBC_EXPORT_STRUCT __declspec(dllimport)
#endif // defined(ADBC_EXPORTING)
#else
#define ADBC_EXPORT_STRUCT
#endif // defined(__cplusplus)
#else
#define ADBC_EXPORT
#define ADBC_EXPORT_STRUCT
#endif // defined(_WIN32)
#endif // !defined(ADBC_EXPORT)

/// \defgroup adbc-error-handling Error Handling
Expand Down Expand Up @@ -266,7 +277,7 @@ typedef uint8_t AdbcStatusCode;
/// ADBC_ERROR_VENDOR_CODE_PRIVATE_DATA. Clients are required to initialize
/// this struct to avoid the possibility of uninitialized values confusing the
/// driver.
struct ADBC_EXPORT AdbcError {
struct ADBC_EXPORT_STRUCT AdbcError {
/// \brief The error message.
char* message;

Expand Down Expand Up @@ -347,7 +358,7 @@ struct ADBC_EXPORT AdbcError {
/// called.
///
/// \since ADBC API revision 1.1.0
struct ADBC_EXPORT AdbcErrorDetail {
struct ADBC_EXPORT_STRUCT AdbcErrorDetail {
/// \brief The metadata key.
const char* key;
/// \brief The binary metadata value.
Expand Down Expand Up @@ -805,7 +816,7 @@ const struct AdbcError* AdbcErrorFromArrayStream(struct ArrowArrayStream* stream
/// \brief An instance of a database.
///
/// Must be kept alive as long as any connections exist.
struct ADBC_EXPORT AdbcDatabase {
struct ADBC_EXPORT_STRUCT AdbcDatabase {
/// \brief Opaque implementation-defined state.
/// This field is NULLPTR iff the connection is unintialized/freed.
void* private_data;
Expand All @@ -828,7 +839,7 @@ struct ADBC_EXPORT AdbcDatabase {
/// Connections are not required to be thread-safe, but they can be
/// used from multiple threads so long as clients take care to
/// serialize accesses to a connection.
struct ADBC_EXPORT AdbcConnection {
struct ADBC_EXPORT_STRUCT AdbcConnection {
/// \brief Opaque implementation-defined state.
/// This field is NULLPTR iff the connection is unintialized/freed.
void* private_data;
Expand Down Expand Up @@ -866,7 +877,7 @@ struct ADBC_EXPORT AdbcConnection {
/// Statements are not required to be thread-safe, but they can be
/// used from multiple threads so long as clients take care to
/// serialize accesses to a statement.
struct ADBC_EXPORT AdbcStatement {
struct ADBC_EXPORT_STRUCT AdbcStatement {
/// \brief Opaque implementation-defined state.
/// This field is NULLPTR iff the connection is unintialized/freed.
void* private_data;
Expand Down Expand Up @@ -933,7 +944,7 @@ struct AdbcPartitions {
/// initialization routines. Drivers should populate this struct, and
/// applications can call ADBC functions through this struct, without
/// worrying about multiple definitions of the same symbol.
struct ADBC_EXPORT AdbcDriver {
struct ADBC_EXPORT_STRUCT AdbcDriver {
/// \brief Opaque driver-defined state.
/// This field is NULL if the driver is unintialized/freed (but
/// it need not have a value even if the driver is initialized).
Expand Down
41 changes: 26 additions & 15 deletions go/adbc/drivermgr/arrow-adbc/adbc.h
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,26 @@ struct ArrowArrayStream {
// Storage class macros for Windows
// Allow overriding/aliasing with application-defined macros
#if !defined(ADBC_EXPORT)
#if defined(_WIN32)
#if defined(ADBC_EXPORTING)
#define ADBC_EXPORT __declspec(dllexport)
#else
#define ADBC_EXPORT __declspec(dllimport)
#endif // defined(ADBC_EXPORTING)
#else
#define ADBC_EXPORT
#endif // defined(_WIN32)
#if defined(_WIN32)
#if defined(ADBC_EXPORTING)
#define ADBC_EXPORT __declspec(dllexport)
#else
#define ADBC_EXPORT __declspec(dllimport)
#endif // defined(ADBC_EXPORTING)

#if defined(__cplusplus)
#if defined(ADBC_EXPORTING)
#define ADBC_EXPORT_STRUCT __declspec(dllexport)
#else
#define ADBC_EXPORT_STRUCT __declspec(dllimport)
#endif // defined(ADBC_EXPORTING)
#else
#define ADBC_EXPORT_STRUCT
#endif // defined(__cplusplus)
#else
#define ADBC_EXPORT
#define ADBC_EXPORT_STRUCT
#endif // defined(_WIN32)
#endif // !defined(ADBC_EXPORT)

/// \defgroup adbc-error-handling Error Handling
Expand Down Expand Up @@ -266,7 +277,7 @@ typedef uint8_t AdbcStatusCode;
/// ADBC_ERROR_VENDOR_CODE_PRIVATE_DATA. Clients are required to initialize
/// this struct to avoid the possibility of uninitialized values confusing the
/// driver.
struct ADBC_EXPORT AdbcError {
struct ADBC_EXPORT_STRUCT AdbcError {
/// \brief The error message.
char* message;

Expand Down Expand Up @@ -347,7 +358,7 @@ struct ADBC_EXPORT AdbcError {
/// called.
///
/// \since ADBC API revision 1.1.0
struct ADBC_EXPORT AdbcErrorDetail {
struct ADBC_EXPORT_STRUCT AdbcErrorDetail {
/// \brief The metadata key.
const char* key;
/// \brief The binary metadata value.
Expand Down Expand Up @@ -805,7 +816,7 @@ const struct AdbcError* AdbcErrorFromArrayStream(struct ArrowArrayStream* stream
/// \brief An instance of a database.
///
/// Must be kept alive as long as any connections exist.
struct ADBC_EXPORT AdbcDatabase {
struct ADBC_EXPORT_STRUCT AdbcDatabase {
/// \brief Opaque implementation-defined state.
/// This field is NULLPTR iff the connection is unintialized/freed.
void* private_data;
Expand All @@ -828,7 +839,7 @@ struct ADBC_EXPORT AdbcDatabase {
/// Connections are not required to be thread-safe, but they can be
/// used from multiple threads so long as clients take care to
/// serialize accesses to a connection.
struct ADBC_EXPORT AdbcConnection {
struct ADBC_EXPORT_STRUCT AdbcConnection {
/// \brief Opaque implementation-defined state.
/// This field is NULLPTR iff the connection is unintialized/freed.
void* private_data;
Expand Down Expand Up @@ -866,7 +877,7 @@ struct ADBC_EXPORT AdbcConnection {
/// Statements are not required to be thread-safe, but they can be
/// used from multiple threads so long as clients take care to
/// serialize accesses to a statement.
struct ADBC_EXPORT AdbcStatement {
struct ADBC_EXPORT_STRUCT AdbcStatement {
/// \brief Opaque implementation-defined state.
/// This field is NULLPTR iff the connection is unintialized/freed.
void* private_data;
Expand Down Expand Up @@ -933,7 +944,7 @@ struct AdbcPartitions {
/// initialization routines. Drivers should populate this struct, and
/// applications can call ADBC functions through this struct, without
/// worrying about multiple definitions of the same symbol.
struct ADBC_EXPORT AdbcDriver {
struct ADBC_EXPORT_STRUCT AdbcDriver {
/// \brief Opaque driver-defined state.
/// This field is NULL if the driver is unintialized/freed (but
/// it need not have a value even if the driver is initialized).
Expand Down
Loading