Skip to content

Commit

Permalink
Add __DEFINED_ssize_t for alpine gcc (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
kuba-- authored Nov 12, 2019
1 parent 196cdd3 commit 6b3c346
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/zip.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,24 @@ extern "C" {
#endif

#if !defined(_SSIZE_T_DEFINED) && !defined(_SSIZE_T_DEFINED_) && \
!defined(_SSIZE_T) && !defined(_SSIZE_T_) && !defined(__ssize_t_defined)
#define _SSIZE_T
!defined(__DEFINED_ssize_t) && !defined(__ssize_t_defined) && \
!defined(_SSIZE_T) && !defined(_SSIZE_T_)

// 64-bit Windows is the only mainstream platform
// where sizeof(long) != sizeof(void*)
#ifdef _WIN64
typedef long long ssize_t; /* byte count or error */
#else
typedef long ssize_t; /* byte count or error */
#endif

#define _SSIZE_T_DEFINED
#define _SSIZE_T_DEFINED_
#define __DEFINED_ssize_t
#define __ssize_t_defined
#define _SSIZE_T
#define _SSIZE_T_

#endif

#ifndef MAX_PATH
Expand Down

0 comments on commit 6b3c346

Please sign in to comment.