armink / FlashDB

An ultra-lightweight database that supports key-value and time series data | 一款支持 KV 数据和时序数据的超轻量级数据库
Apache License 2.0
1.84k stars 426 forks source link

FDB_USING_FILE_POSIX_MODE + C optimize cause error #222

Closed BecauseItIsThere closed 11 months ago

BecauseItIsThere commented 1 year ago

Hi, with C optimization and FDB_USING_FILE_POSIX_MODE enabled, compiling 'fdsb.c` fails. Could you check?

cc -O2 -g3 -Wall -c ../../src/fdb.c -o ../../src/fdb.o -I./applications -I../../inc
In file included from /usr/include/unistd.h:1214,
                 from ../../src/fdb.c:120:
/usr/include/x86_64-linux-gnu/bits/unistd.h: In function ‘_fdb_deinit’:
/usr/include/x86_64-linux-gnu/bits/unistd.h:36:1: error: nested function ‘read’ declared ‘extern’
... 
(Many errors follow)

To reproduce, under demos/linux

Thank you in advance!

armink commented 1 year ago

can you fix it and push a PR?