Skip to content

Commit 088df08

Browse files
committed
Fixed compile issue
1 parent e6bb104 commit 088df08

File tree

3 files changed

+53
-31
lines changed

3 files changed

+53
-31
lines changed

c/driver/sqlite/statement_reader.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ extern "C" {
2828
#endif
2929

3030
/// \brief Helper to manage binding data to a SQLite statement.
31-
struct ADBC_EXPORT AdbcSqliteBinder {
31+
struct ADBC_EXPORT_STRUCT AdbcSqliteBinder {
3232
// State
3333
struct ArrowSchema schema;
3434
struct ArrowArrayStream params;

c/include/arrow-adbc/adbc.h

+26-15
Original file line numberDiff line numberDiff line change
@@ -152,15 +152,26 @@ struct ArrowArrayStream {
152152
// Storage class macros for Windows
153153
// Allow overriding/aliasing with application-defined macros
154154
#if !defined(ADBC_EXPORT)
155-
#if defined(_WIN32)
156-
#if defined(ADBC_EXPORTING)
157-
#define ADBC_EXPORT __declspec(dllexport)
158-
#else
159-
#define ADBC_EXPORT __declspec(dllimport)
160-
#endif // defined(ADBC_EXPORTING)
161-
#else
162-
#define ADBC_EXPORT
163-
#endif // defined(_WIN32)
155+
#if defined(_WIN32)
156+
#if defined(ADBC_EXPORTING)
157+
#define ADBC_EXPORT __declspec(dllexport)
158+
#else
159+
#define ADBC_EXPORT __declspec(dllimport)
160+
#endif // defined(ADBC_EXPORTING)
161+
162+
#if defined(__cplusplus)
163+
#if defined(ADBC_EXPORTING)
164+
#define ADBC_EXPORT_STRUCT __declspec(dllexport)
165+
#else
166+
#define ADBC_EXPORT_STRUCT __declspec(dllimport)
167+
#endif // defined(ADBC_EXPORTING)
168+
#else
169+
#define ADBC_EXPORT_STRUCT
170+
#endif // defined(__cplusplus)
171+
#else
172+
#define ADBC_EXPORT
173+
#define ADBC_EXPORT_STRUCT
174+
#endif // defined(_WIN32)
164175
#endif // !defined(ADBC_EXPORT)
165176

166177
/// \defgroup adbc-error-handling Error Handling
@@ -266,7 +277,7 @@ typedef uint8_t AdbcStatusCode;
266277
/// ADBC_ERROR_VENDOR_CODE_PRIVATE_DATA. Clients are required to initialize
267278
/// this struct to avoid the possibility of uninitialized values confusing the
268279
/// driver.
269-
struct ADBC_EXPORT AdbcError {
280+
struct ADBC_EXPORT_STRUCT AdbcError {
270281
/// \brief The error message.
271282
char* message;
272283

@@ -347,7 +358,7 @@ struct ADBC_EXPORT AdbcError {
347358
/// called.
348359
///
349360
/// \since ADBC API revision 1.1.0
350-
struct ADBC_EXPORT AdbcErrorDetail {
361+
struct ADBC_EXPORT_STRUCT AdbcErrorDetail {
351362
/// \brief The metadata key.
352363
const char* key;
353364
/// \brief The binary metadata value.
@@ -805,7 +816,7 @@ const struct AdbcError* AdbcErrorFromArrayStream(struct ArrowArrayStream* stream
805816
/// \brief An instance of a database.
806817
///
807818
/// Must be kept alive as long as any connections exist.
808-
struct ADBC_EXPORT AdbcDatabase {
819+
struct ADBC_EXPORT_STRUCT AdbcDatabase {
809820
/// \brief Opaque implementation-defined state.
810821
/// This field is NULLPTR iff the connection is unintialized/freed.
811822
void* private_data;
@@ -828,7 +839,7 @@ struct ADBC_EXPORT AdbcDatabase {
828839
/// Connections are not required to be thread-safe, but they can be
829840
/// used from multiple threads so long as clients take care to
830841
/// serialize accesses to a connection.
831-
struct ADBC_EXPORT AdbcConnection {
842+
struct ADBC_EXPORT_STRUCT AdbcConnection {
832843
/// \brief Opaque implementation-defined state.
833844
/// This field is NULLPTR iff the connection is unintialized/freed.
834845
void* private_data;
@@ -866,7 +877,7 @@ struct ADBC_EXPORT AdbcConnection {
866877
/// Statements are not required to be thread-safe, but they can be
867878
/// used from multiple threads so long as clients take care to
868879
/// serialize accesses to a statement.
869-
struct ADBC_EXPORT AdbcStatement {
880+
struct ADBC_EXPORT_STRUCT AdbcStatement {
870881
/// \brief Opaque implementation-defined state.
871882
/// This field is NULLPTR iff the connection is unintialized/freed.
872883
void* private_data;
@@ -933,7 +944,7 @@ struct AdbcPartitions {
933944
/// initialization routines. Drivers should populate this struct, and
934945
/// applications can call ADBC functions through this struct, without
935946
/// worrying about multiple definitions of the same symbol.
936-
struct ADBC_EXPORT AdbcDriver {
947+
struct ADBC_EXPORT_STRUCT AdbcDriver {
937948
/// \brief Opaque driver-defined state.
938949
/// This field is NULL if the driver is unintialized/freed (but
939950
/// it need not have a value even if the driver is initialized).

go/adbc/drivermgr/arrow-adbc/adbc.h

+26-15
Original file line numberDiff line numberDiff line change
@@ -152,15 +152,26 @@ struct ArrowArrayStream {
152152
// Storage class macros for Windows
153153
// Allow overriding/aliasing with application-defined macros
154154
#if !defined(ADBC_EXPORT)
155-
#if defined(_WIN32)
156-
#if defined(ADBC_EXPORTING)
157-
#define ADBC_EXPORT __declspec(dllexport)
158-
#else
159-
#define ADBC_EXPORT __declspec(dllimport)
160-
#endif // defined(ADBC_EXPORTING)
161-
#else
162-
#define ADBC_EXPORT
163-
#endif // defined(_WIN32)
155+
#if defined(_WIN32)
156+
#if defined(ADBC_EXPORTING)
157+
#define ADBC_EXPORT __declspec(dllexport)
158+
#else
159+
#define ADBC_EXPORT __declspec(dllimport)
160+
#endif // defined(ADBC_EXPORTING)
161+
162+
#if defined(__cplusplus)
163+
#if defined(ADBC_EXPORTING)
164+
#define ADBC_EXPORT_STRUCT __declspec(dllexport)
165+
#else
166+
#define ADBC_EXPORT_STRUCT __declspec(dllimport)
167+
#endif // defined(ADBC_EXPORTING)
168+
#else
169+
#define ADBC_EXPORT_STRUCT
170+
#endif // defined(__cplusplus)
171+
#else
172+
#define ADBC_EXPORT
173+
#define ADBC_EXPORT_STRUCT
174+
#endif // defined(_WIN32)
164175
#endif // !defined(ADBC_EXPORT)
165176

166177
/// \defgroup adbc-error-handling Error Handling
@@ -266,7 +277,7 @@ typedef uint8_t AdbcStatusCode;
266277
/// ADBC_ERROR_VENDOR_CODE_PRIVATE_DATA. Clients are required to initialize
267278
/// this struct to avoid the possibility of uninitialized values confusing the
268279
/// driver.
269-
struct ADBC_EXPORT AdbcError {
280+
struct ADBC_EXPORT_STRUCT AdbcError {
270281
/// \brief The error message.
271282
char* message;
272283

@@ -347,7 +358,7 @@ struct ADBC_EXPORT AdbcError {
347358
/// called.
348359
///
349360
/// \since ADBC API revision 1.1.0
350-
struct ADBC_EXPORT AdbcErrorDetail {
361+
struct ADBC_EXPORT_STRUCT AdbcErrorDetail {
351362
/// \brief The metadata key.
352363
const char* key;
353364
/// \brief The binary metadata value.
@@ -805,7 +816,7 @@ const struct AdbcError* AdbcErrorFromArrayStream(struct ArrowArrayStream* stream
805816
/// \brief An instance of a database.
806817
///
807818
/// Must be kept alive as long as any connections exist.
808-
struct ADBC_EXPORT AdbcDatabase {
819+
struct ADBC_EXPORT_STRUCT AdbcDatabase {
809820
/// \brief Opaque implementation-defined state.
810821
/// This field is NULLPTR iff the connection is unintialized/freed.
811822
void* private_data;
@@ -828,7 +839,7 @@ struct ADBC_EXPORT AdbcDatabase {
828839
/// Connections are not required to be thread-safe, but they can be
829840
/// used from multiple threads so long as clients take care to
830841
/// serialize accesses to a connection.
831-
struct ADBC_EXPORT AdbcConnection {
842+
struct ADBC_EXPORT_STRUCT AdbcConnection {
832843
/// \brief Opaque implementation-defined state.
833844
/// This field is NULLPTR iff the connection is unintialized/freed.
834845
void* private_data;
@@ -866,7 +877,7 @@ struct ADBC_EXPORT AdbcConnection {
866877
/// Statements are not required to be thread-safe, but they can be
867878
/// used from multiple threads so long as clients take care to
868879
/// serialize accesses to a statement.
869-
struct ADBC_EXPORT AdbcStatement {
880+
struct ADBC_EXPORT_STRUCT AdbcStatement {
870881
/// \brief Opaque implementation-defined state.
871882
/// This field is NULLPTR iff the connection is unintialized/freed.
872883
void* private_data;
@@ -933,7 +944,7 @@ struct AdbcPartitions {
933944
/// initialization routines. Drivers should populate this struct, and
934945
/// applications can call ADBC functions through this struct, without
935946
/// worrying about multiple definitions of the same symbol.
936-
struct ADBC_EXPORT AdbcDriver {
947+
struct ADBC_EXPORT_STRUCT AdbcDriver {
937948
/// \brief Opaque driver-defined state.
938949
/// This field is NULL if the driver is unintialized/freed (but
939950
/// it need not have a value even if the driver is initialized).

0 commit comments

Comments
 (0)