mpx / lua-cjson

Lua CJSON is a fast JSON encoding/parsing module for Lua
https://kyne.au/~mark/software/lua-cjson.php
MIT License
933 stars 478 forks source link

Compilation issue: Redefinition of fpconv_init when defining USE_INTERNAL_FPCONV #60

Open arnaudfoisset opened 6 years ago

arnaudfoisset commented 6 years ago

Hi, I'm trying to compile lua-json with the USE_INTERNAL_FPCONV file and get the following compliation error:

fpconv.c:205:6: error: redefinition of ‘fpconv_init’
 void fpconv_init()
      ^~~~~~~~~~~
In file included from fpconv.c:36:0:
fpconv.h:10:20: note: previous definition of ‘fpconv_init’ was here
 static inline void fpconv_init()
                    ^~~~~~~~~~~
Makefile:90: recipe for target 'fpconv.o' failed
make[1]: *** [fpconv.o] Error 1

Indeed, fpconv_init is defined in both fpconv.c and fpconv.h. A fix could be undefining fpconv_init() in fpconv.c under the same flag.

What do you think?