Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: 'O_BINARY' undeclared when compiling in Msys2 environment on Windows #7

Open
bardware opened this issue Jul 18, 2017 · 1 comment

Comments

@bardware
Copy link

Hi,

I checked this repo out in a msys2 environment under windows and call make. I eventually end up with the error

woff2sfnt.c:189:33: error: 'O_BINARY' undeclared (first use in this function)
         setmode(fileno(stdout), O_BINARY);

A quick search came up with this. Have you heard of this before?

Best,
Bernhard

@bardware bardware changed the title error: 'O_BINARY' undeclared error: 'O_BINARY' undeclared when compiling in Msys2 environment on Windows Jan 17, 2018
@nickbeth
Copy link

nickbeth commented Oct 6, 2021

To fix this add this piece of code to the top of woff2sfnt.c, below the last #include:

#ifdef WIN32
  #include <fcntl.h>
  #include <io.h>

  #if defined(_O_BINARY) && !defined(O_BINARY)
    #define O_BINARY _O_BINARY
    #define setmode  _setmode
    #define fileno   _fileno
  #endif
#endif

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants