Menu

#311 CMake + MSVC: '_setmode' undefined

1.27.x
closed-fixed
nobody
None
5
2021-06-05
2021-05-30
No

in libout123/wav.c:

#ifdef WIN32
        _setmode(STDOUT_FILENO, _O_BINARY);
#endif

produces warning:

D:\source\repos\libmpg123\src\libout123\wav.c(174): warning C4013: '_setmode' undefined; assuming extern returning int

Forgotten header is <io.h>, see https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/setmode?view=msvc-160.

Discussion

  • Thomas Orgis

    Thomas Orgis - 2021-05-30

    This is MSVC-only, right? Mingw seems to just offer this one with some other standard header.

    I added an include for that in src/compat/compat.h. Warning is hopefully gone.

     
  • Thomas Orgis

    Thomas Orgis - 2021-06-05
    • status: open --> closed-fixed
     
  • Thomas Orgis

    Thomas Orgis - 2021-06-05

    fixed in 1.28.0

     

Log in to post a comment.