Skip to content

Commit

Permalink
No extra check if SSIZE_T is defined (#148)
Browse files Browse the repository at this point in the history
  • Loading branch information
kuba-- authored Nov 18, 2020
1 parent ffe690c commit cc1f3d5
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions src/zip.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,27 +19,14 @@
extern "C" {
#endif

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

#if !defined(_POSIX_C_SOURCE) && defined(_MSC_VER)
// 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_
#define _SSIZE_T_DECLARED
#define __have_typedef_ssize_t
#endif

#ifndef MAX_PATH
Expand Down

3 comments on commit cc1f3d5

@kuba--
Copy link
Owner Author

@kuba-- kuba-- commented on cc1f3d5 Jan 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danoli3 - do you mean, on Android 32 neither ssize_t is defined not _POSIX_C_SOURCE.
PTAL if following fix: https://github.com/kuba--/zip/pull/228/files works for you

@kuba--
Copy link
Owner Author

@kuba-- kuba-- commented on cc1f3d5 Jan 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danoli3
Copy link

@danoli3 danoli3 commented on cc1f3d5 Jan 10, 2022 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.