Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/zabbix/zabbix.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndris Zeila <andris.zeila@zabbix.com>2022-07-11 09:49:18 +0300
committerAndris Zeila <andris.zeila@zabbix.com>2022-07-11 09:52:42 +0300
commita096993fb12504de382e35f1b6779829729a60d1 (patch)
tree0221f97f735a27126a5c67c27bccb3cc9172f19f /include/zbxtypes.h
parent15e3ecf2870e99613fa7036213dc39021d211069 (diff)
...G...... [ZBX-20203] fixed agent2 log* item large file support on windows
Merge in ZBX/zabbix from feature/ZBX-20203-5.0 to release/5.0 * commit 'aa20e67c4e1c09a57af52b1a17ecc2c8015c99ed': .D........ [ZBX-20203] added changelog entry .......... [ZBX-20203] added zbx_stat, zbx_fstat, zbx_lseek implementations for agent2 (minggw) (cherry picked from commit 3a3a94740a560d12051695d38533c61b10f6f9df)
Diffstat (limited to 'include/zbxtypes.h')
-rw-r--r--include/zbxtypes.h31
1 files changed, 21 insertions, 10 deletions
diff --git a/include/zbxtypes.h b/include/zbxtypes.h
index e39f7602f9d..ba799ab27c0 100644
--- a/include/zbxtypes.h
+++ b/include/zbxtypes.h
@@ -52,9 +52,6 @@
#if defined(_WINDOWS)
# include <strsafe.h>
-# define zbx_stat(path, buf) __zbx_stat(path, buf)
-# define zbx_fstat(fd, buf) _fstat64(fd, buf)
-
# ifndef __UINT64_C
# define __UINT64_C(x) x
# endif
@@ -85,9 +82,6 @@ typedef uint32_t zbx_uint32_t;
# define strcasecmp lstrcmpiA
-typedef __int64 zbx_offset_t;
-# define zbx_lseek(fd, offset, whence) _lseeki64(fd, (zbx_offset_t)(offset), whence)
-
# if defined(__INT_MAX__) && __INT_MAX__ == 2147483647
typedef int ssize_t;
# else
@@ -95,9 +89,6 @@ typedef long ssize_t;
# endif
#else /* _WINDOWS */
-# define zbx_stat(path, buf) stat(path, buf)
-# define zbx_fstat(fd, buf) fstat(fd, buf)
-
# ifndef __UINT64_C
# ifdef UINT64_C
# define __UINT64_C(c) (UINT64_C(c))
@@ -162,10 +153,30 @@ typedef long ssize_t;
typedef uint32_t zbx_uint32_t;
+#endif /* _WINDOWS */
+
+#if defined(_WINDOWS)
+# define zbx_stat(path, buf) __zbx_stat(path, buf)
+# define zbx_fstat(fd, buf) _fstat64(fd, buf)
+
+typedef __int64 zbx_offset_t;
+# define zbx_lseek(fd, offset, whence) _lseeki64(fd, (zbx_offset_t)(offset), whence)
+
+#elif defined(__MINGW32__)
+# define zbx_stat(path, buf) _stat64(path, buf)
+# define zbx_fstat(fd, buf) _fstat64(fd, buf)
+
+typedef off64_t zbx_offset_t;
+# define zbx_lseek(fd, offset, whence) lseek64(fd, (zbx_offset_t)(offset), whence)
+
+#else
+# define zbx_stat(path, buf) stat(path, buf)
+# define zbx_fstat(fd, buf) fstat(fd, buf)
+
typedef off_t zbx_offset_t;
# define zbx_lseek(fd, offset, whence) lseek(fd, (zbx_offset_t)(offset), whence)
-#endif /* _WINDOWS */
+#endif
#define ZBX_FS_DBL "%lf"
#define ZBX_FS_DBL_EXT(p) "%." #p "lf"