aboutsummaryrefslogtreecommitdiffstats
path: root/include/ws_posix_compat.h
blob: 922e0a2b9ac80f78c3fc10b3c78a2c8553fdd8bf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* ws_posix_compat.h
 * Definitions for POSIX compatibility.
 *
 * Wireshark - Network traffic analyzer
 * By Gerald Combs <gerald@wireshark.org>
 * Copyright 1998 Gerald Combs
 *
 * SPDX-License-Identifier: GPL-2.0-or-later
 */

#ifndef __POSIX_COMPAT_H__
#define __POSIX_COMPAT_H__

#include <stdint.h>
#include <limits.h>

#if !defined(SSIZE_MAX) && !defined(HAVE_SSIZE_T)
#if defined(_WIN64)

typedef int64_t ssize_t;

#define SSIZE_MAX INT64_MAX

#else /* !_WIN64 */

typedef signed long int ssize_t;

#define SSIZE_MAX LONG_MAX

#endif /* _WIN64 */
#endif /* !SSIZE_MAX && !HAVE_SSIZE_T */

#endif /* __POSIX_COMPAT_H__ */