facil-io / cstl

facil.io C STL - a Server Toolbox Library for C, including JSON processing, hash maps, dynamic arrays, binary strings and more.
https://facil.io
MIT License
71 stars 6 forks source link

Fix FIO_STR_NAME_write naming #4

Closed janbiedermann closed 1 year ago

boazsegev commented 1 year ago

Hi @janbiedermann,

Thank you for highlighting the problem.

However the issue is more of a symptom than a cause. The FIO_STR_NAME module shouldn't have any knowledge about the patches module.

The way I see it is that I either:

  1. Shadow the write function with a localized static function (the same would be done for all macro names).

  2. use a function style MACRO(...) instead (can't be done, as sometimes we need a pointer to the function).

Also, if we #undef write we might end up with errors further down stream.

What do you think?

boazsegev commented 1 year ago

I renamed the functions to avoid the issue. I hope now it works.

janbiedermann commented 1 year ago

I have some issues with MingW on Windows hopefully visible in the MingW CI PR, ill fix them

boazsegev commented 1 year ago

I'm pushing a possible fix for the issue of double-patching Windows with MinGW.