thorfdbg / libjpeg

A complete implementation of 10918-1 (JPEG) coming from jpeg.org (the ISO group) with extensions for HDR, lossless and alpha channel coding standardized as ISO/IEC 18477 (JPEG XT).
327 stars 81 forks source link

MSVC 2022 Compilation error due to use of ssize_t #91

Closed scaramallion closed 10 months ago

scaramallion commented 10 months ago

Running into an issue compiling using C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Tools\\MSVC\\14.37.32822\\bin\\HostX86\\x86\\cl.exe

 bitmaphook.cpp
    D:\a\libjpeg\cmd\bitmaphook.cpp(163): error C2065: 'ssize_t': undeclared identifier
    D:\a\libjpeg\cmd\bitmaphook.cpp(163): error C2146: syntax error: missing ';' before identifier 'cnt'
    D:\a\libjpeg\cmd\bitmaphook.cpp(163): error C2065: 'cnt': undeclared identifier
    D:\a\libjpeg\cmd\bitmaphook.cpp(165): error C2065: 'cnt': undeclared identifier
    D:\a\libjpeg\cmd\bitmaphook.cpp(208): error C2065: 'ssize_t': undeclared identifier
    D:\a\libjpeg\cmd\bitmaphook.cpp(208): error C2146: syntax error: missing ';' before identifier 'cnt'
    D:\a\libjpeg\cmd\bitmaphook.cpp(208): error C2065: 'cnt': undeclared identifier
    D:\a\libjpeg\cmd\bitmaphook.cpp(210): error C2065: 'cnt': undeclared identifier
    D:\a\libjpeg\cmd\bitmaphook.cpp(447): error C2065: 'ssize_t': undeclared identifier
    D:\a\libjpeg\cmd\bitmaphook.cpp(447): error C2146: syntax error: missing ';' before identifier 'cnt'
    D:\a\libjpeg\cmd\bitmaphook.cpp(447): error C2065: 'cnt': undeclared identifier
    D:\a\libjpeg\cmd\bitmaphook.cpp(449): error C2065: 'cnt': undeclared identifier

Introduced by 9e0cea2, from what I understand ssize_t is a posix extension that isn't actually in the standard?

Compilation is OK with db33a6ee2d034eea2c62fd3c5dcb6fa86746579f

thorfdbg commented 10 months ago

Fixed.