Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: json-c 0.17 compatibility with ssize_t type definition (1.0.4) #1064

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -676,13 +676,13 @@ check_type_size("ssize_t" SIZEOF_SSIZE_T)
if(SIZEOF_SSIZE_T STREQUAL "")
# ssize_t is a signed type in POSIX storing at least -1.
# Set it to "int" to match the behavior of AC_TYPE_SSIZE_T (autotools).
set(ssize_t int)
set(SSIZE_T_DEF "typedef int ssize_t;")
endif()
check_type_size("off_t" SIZEOF_OFF_T)
if(SIZEOF_OFF_T STREQUAL "")
# off_t is a signed type in POSIX no narrower than int.
# Set it to "long int" to match the behavior of AC_TYPE_OFF_T (autotools).
set(off_t long int)
set(OFF_T_DEF "typedef long int off_t;")
endif()

check_type_size("int" SIZEOF_INT)
Expand Down
19 changes: 15 additions & 4 deletions clamav-config.h.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -590,11 +590,22 @@
#define inline @INLINE_KEYWORD@
#endif

/* Define to `long int' if <sys/types.h> does not define. */
#cmakedefine off_t @off_t@

/* Define to `int' if <sys/types.h> does not define. */
#cmakedefine ssize_t @ssize_t@
#ifndef SSIZE_T_DEFINED
#if defined(_MSC_VER)
#include <BaseTsd.h>
typedef SSIZE_T ssize_t;
#else
@SSIZE_T_DEF@
#endif
# define SSIZE_T_DEFINED
#endif

/* Define to `long int' if <sys/types.h> does not define. */
#ifndef OFF_T_DEFINED
@OFF_T_DEF@
#define OFF_T_DEFINED
#endif

/* Define to the equivalent of the C99 'restrict' keyword, or to
nothing if this is not supported. Do not define if restrict is
Expand Down
8 changes: 7 additions & 1 deletion win32/compat/net.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,15 @@

/* Don't include clamav-config.h, because that brings in platform.h
and platform.h will make these functions recursive ;-). */
#ifndef ssize_t
#ifndef SSIZE_T_DEFINED
#if defined(_MSC_VER)
#include <BaseTsd.h>
typedef SSIZE_T ssize_t;
#else
typedef int ssize_t;
#endif
#define SSIZE_T_DEFINED
#endif

#define F_GETFL 1
#define F_SETFL 2
Expand Down
Loading