[Commits] f89c9fc: MDEV-7526: TokuDB doesn't build on OS X

Vicentiu Ciorbaru vicentiu at mariadb.org
Sat Dec 19 14:16:32 EET 2015


revision-id: f89c9fc4b7b5d82c79775cb848225900b45a6b79 (mariadb-5.5.47-7-gf89c9fc)
parent(s): 0ed474484c037a32bea32abaecd3ff770f40bd49
author: Vicențiu Ciorbaru
committer: Vicențiu Ciorbaru
timestamp: 2015-12-19 14:14:05 +0200
message:

MDEV-7526: TokuDB doesn't build on OS X

This patch fixes one compilation error related to __db_lsn struct. The
struct can not be defined as empty according to the main C standard.
In C++, this is handled by forcing a size of 1. To eliminate the error
we add a dummy char field of size 1. This has no effect on the C++
compiled code, but also removes the compiler error.

---
 storage/tokudb/ft-index/buildheader/make_tdb.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/storage/tokudb/ft-index/buildheader/make_tdb.cc b/storage/tokudb/ft-index/buildheader/make_tdb.cc
index 5370664..610ce67 100644
--- a/storage/tokudb/ft-index/buildheader/make_tdb.cc
+++ b/storage/tokudb/ft-index/buildheader/make_tdb.cc
@@ -481,7 +481,9 @@ static void print_db_key_range_struct (void) {
 
 static void print_db_lsn_struct (void) {
     field_counter=0;
-    sort_and_dump_fields("db_lsn", false, NULL);
+    /* A dummy field to make sizeof(DB_LSN) equal in C and C++ */
+    const char *extra[] = { "char dummy", NULL };
+    sort_and_dump_fields("db_lsn", false, extra);
 }
 
 static void print_dbt_struct (void) {


More information about the commits mailing list