From fbe24f72d748f25fd80b84217b6f2f1eec3d099c Mon Sep 17 00:00:00 2001 From: Yury Kurlykov Date: Wed, 30 Oct 2019 22:09:01 +1000 Subject: [PATCH] Fix C++ integration --- inc/YeltsinDB/table_page.h | 9 +++++++-- inc/YeltsinDB/ydb.h | 10 +++++++++- src/table_page.c | 7 ++++++- src/ydb.c | 8 ++++++++ 4 files changed, 30 insertions(+), 4 deletions(-) diff --git a/inc/YeltsinDB/table_page.h b/inc/YeltsinDB/table_page.h index 4cc4f56..1c0716a 100644 --- a/inc/YeltsinDB/table_page.h +++ b/inc/YeltsinDB/table_page.h @@ -1,5 +1,9 @@ #pragma once +#ifdef __cplusplus +extern "C" { +#endif + #include #include @@ -100,5 +104,6 @@ YDB_PageSize ydb_page_row_count_get(YDB_TablePage* page); */ void ydb_page_row_count_set(YDB_TablePage* page, YDB_PageSize row_count); - - +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/inc/YeltsinDB/ydb.h b/inc/YeltsinDB/ydb.h index b70ba00..b7197fd 100644 --- a/inc/YeltsinDB/ydb.h +++ b/inc/YeltsinDB/ydb.h @@ -1,5 +1,9 @@ #pragma once +#ifdef __cplusplus +extern "C" { +#endif + #include #include #include @@ -148,4 +152,8 @@ YDB_Error ydb_delete_current_page(YDB_Engine* instance); * - types.h * * And in some cases even [table file structure](table_file.md) - */ \ No newline at end of file + */ + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/src/table_page.c b/src/table_page.c index 1f772d8..c58b90f 100644 --- a/src/table_page.c +++ b/src/table_page.c @@ -1,3 +1,6 @@ +#ifdef __cplusplus +extern "C" { +#endif #include #include #include @@ -112,5 +115,7 @@ void ydb_page_row_count_set(YDB_TablePage *page, YDB_PageSize row_count) { page->row_count = row_count; } - +#ifdef __cplusplus +} +#endif diff --git a/src/ydb.c b/src/ydb.c index ccbcbc1..b7a6ae2 100644 --- a/src/ydb.c +++ b/src/ydb.c @@ -1,3 +1,7 @@ +#ifdef __cplusplus +extern "C" { +#endif + #include #include #include @@ -377,3 +381,7 @@ YDB_Error ydb_delete_current_page(YDB_Engine *instance) { return YDB_ERR_SUCCESS; } + +#ifdef __cplusplus +} +#endif \ No newline at end of file