sheredom / json.h

🗄️ single header json parser for C and C++
The Unlicense
698 stars 77 forks source link

Single file distribution #61

Closed ghost closed 5 years ago

ghost commented 5 years ago

Would it be possible to append the C file into the header file and wrap it in #if !defined(SHEREDOM_JSON_HEADER) to streamline unity builds? (or alternatively #if defined(SHEREDOM_JSON_IMPLEMENTATION); I prefer the first style in contrast to stb-style for unity builds, but the second may be less confusing for stb users)

sheredom commented 5 years ago

Entirely possible - but I really hate the 'just do a #define in a single C file' way of doing single libs to be honest.

I could probably move all the functions into the header and have them marked inline, I'll look into that.

mackron commented 5 years ago

Does #include "json.c" not suffice?

ghost commented 5 years ago

@sheredom that is perfectly fine and it is not hard for me to just pack them into a single file. I was just curious what you think. My current build process is to have main.c and everything is a header file, so I actually prefer to #define when not using unity builds (stb libraries do the reverse). Saying no is important and I appreciate it.