From dc0d48bdf7d29f5bd3fa579e9751a7ad6a302573 Mon Sep 17 00:00:00 2001 From: auxten Date: Wed, 20 Mar 2024 19:30:20 +0800 Subject: [PATCH] Fix struct defination of C --- programs/local/chdb.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/programs/local/chdb.h b/programs/local/chdb.h index 7e60d3d2cf6..1f4ae3835c4 100644 --- a/programs/local/chdb.h +++ b/programs/local/chdb.h @@ -20,6 +20,7 @@ struct local_result uint64_t bytes_read; }; +#ifdef __cplusplus struct local_result_v2 { char * buf = nullptr; @@ -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 *, 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);