HappySeaFox / sail

The missing small and fast image decoding library for humans (not for machines) ⛵ https://sail.software
MIT License
311 stars 25 forks source link

_SH_DENYWR undeclared when building with MinGW-w64 #208

Closed brechtsanders closed 6 months ago

brechtsanders commented 6 months ago

When building version 0.9.2 on Windows with MinGW-w64 GCC the build failed with the following error.

sail-0.9.2/src/sail-common/utils.c:721:38: error: '_SH_DENYWR' undeclared (first use in this function)
  721 |     FILE *f = _wfsopen(wpath, L"rb", _SH_DENYWR);
      |                                      ^~~~~~~~~~

When adding the following line at the top of src/sail-common/utils.c the build succeeds:

#include <share.h>

I haven't checked if this is an issue on other platforms or if share.h also exists on all platforms where sail normally builds.

HappySeaFox commented 6 months ago

50abb11