kuba-- / zip

A portable, simple zip library written in C
MIT License
1.42k stars 276 forks source link

typedef conflict #304

Closed U7nk closed 1 year ago

U7nk commented 1 year ago

zip.h

38  #if !defined(_POSIX_C_SOURCE) && defined(_MSC_VER)
39  // 64-bit Windows is the only mainstream platform
40  // where sizeof(long) != sizeof(void*)
41  #ifdef _WIN64
42  typedef long long ssize_t; /* byte count or error */
43  #else
44  typedef long ssize_t; /* byte count or error */
45  #endif
46  #endif

On win 32 typedef definitions of ssize_t is conflicting with definition from drogon framework of version 1.7.1.

In newer versions of drogon it defined differently, maybe conflict also occurs with newer version.

I'm unable to compile my project with both drogon 1.7.1 and zip, because I'm getting C2371 'ssize_t': redefinition; different basic types

kuba-- commented 1 year ago

Why do you think it's an issue in this library?

Here ssize_t is defined if you try to compile MSC and no POSIX is supported. On drogon, ssize_t is defined just if you are on _WIN32. So, I would recommend to either submit an issue to drogon, or add some tricks to your code (like defining POSIX before you include)