Skip to content

Commit

Permalink
Fix struct defination of C
Browse files Browse the repository at this point in the history
  • Loading branch information
auxten committed Mar 20, 2024
1 parent e623e4a commit dc0d48b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions programs/local/chdb.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ struct local_result
uint64_t bytes_read;
};

#ifdef __cplusplus
struct local_result_v2
{
char * buf = nullptr;
Expand All @@ -30,6 +31,18 @@ struct local_result_v2
uint64_t bytes_read = 0;
char * error_message = nullptr;
};
#else
struct local_result_v2
{
char * buf;
size_t len;
void * _vec; // std::vector<char> *, for freeing
double elapsed;
uint64_t rows_read;
uint64_t bytes_read;
char * error_message;
};
#endif

CHDB_EXPORT struct local_result * query_stable(int argc, char ** argv);
CHDB_EXPORT void free_result(struct local_result * result);
Expand Down

0 comments on commit dc0d48b

Please sign in to comment.