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>2014-04-08 16:49:23 +0400
committerAndris Zeila <andris.zeila@zabbix.com>2014-04-08 16:49:23 +0400
commit64af8f342eff7c5a01af4cf7b6f6459597e49582 (patch)
tree75ad699cef98a9ddcb34d0da69e1214cb1d7ce54 /include/zbxtypes.h
parent37623b3fd477d28463d76e56e5abd39f502c5c56 (diff)
...G...... [ZBX-7856] added workaround for Windows _wstat64() not working with symlinks
[merge ^/branches/2.2 -c r44213]
Diffstat (limited to 'include/zbxtypes.h')
-rw-r--r--include/zbxtypes.h86
1 files changed, 35 insertions, 51 deletions
diff --git a/include/zbxtypes.h b/include/zbxtypes.h
index fa300cb9508..77f9933aae7 100644
--- a/include/zbxtypes.h
+++ b/include/zbxtypes.h
@@ -27,55 +27,41 @@
#if defined(_WINDOWS)
-#ifdef _UNICODE
# define zbx_stat(path, buf) __zbx_stat(path, buf)
# define zbx_open(pathname, flags) __zbx_open(pathname, flags | O_BINARY)
-#else
-# define zbx_stat(path, buf) _stat64(path, buf)
-# define zbx_open(pathname, flags) open(pathname, flags | O_BINARY)
-#endif
-#ifdef UNICODE
# include <strsafe.h>
-# define zbx_wsnprintf StringCchPrintf
-# define zbx_strlen wcslen
-# define zbx_strchr wcschr
-# define zbx_strstr wcsstr
-# define zbx_fullpath _wfullpath
-#else
-# define zbx_wsnprintf zbx_snprintf
-# define zbx_strlen strlen
-# define zbx_strchr strchr
-# define zbx_strstr strstr
-# define zbx_fullpath _fullpath
-#endif
+# define zbx_wsnprintf StringCchPrintf
+# define zbx_strlen wcslen
+# define zbx_strchr wcschr
+# define zbx_strstr wcsstr
+# define zbx_fullpath _wfullpath
-#ifndef __UINT64_C
-# define __UINT64_C(x) x
-#endif
+# ifndef __UINT64_C
+# define __UINT64_C(x) x
+# endif
-# define zbx_uint64_t unsigned __int64
-# define ZBX_FS_UI64 "%I64u"
-# define ZBX_FS_UO64 "%I64o"
-# define ZBX_FS_UX64 "%I64x"
+# define zbx_uint64_t unsigned __int64
+# define ZBX_FS_UI64 "%I64u"
+# define ZBX_FS_UO64 "%I64o"
+# define ZBX_FS_UX64 "%I64x"
-# define stat _stat64
# define snprintf _snprintf
# define alloca _alloca
-#ifndef uint32_t
-# define uint32_t __int32
-#endif
+# ifndef uint32_t
+# define uint32_t __int32
+# endif
-#ifndef PATH_SEPARATOR
-# define PATH_SEPARATOR '\\'
-#endif
+# ifndef PATH_SEPARATOR
+# define PATH_SEPARATOR '\\'
+# endif
# define strcasecmp lstrcmpiA
typedef __int64 zbx_offset_t;
-#define zbx_lseek(fd, offset, whence) _lseeki64(fd, (zbx_offset_t)(offset), whence)
+# define zbx_lseek(fd, offset, whence) _lseeki64(fd, (zbx_offset_t)(offset), whence)
#else /* _WINDOWS */
@@ -84,37 +70,35 @@ typedef __int64 zbx_offset_t;
# ifndef __UINT64_C
# ifdef UINT64_C
-# define __UINT64_C(c) (UINT64_C(c))
+# define __UINT64_C(c) (UINT64_C(c))
# else
-# define __UINT64_C(c) (c ## ULL)
+# define __UINT64_C(c) (c ## ULL)
# endif
# endif
-# define zbx_uint64_t uint64_t
+# define zbx_uint64_t uint64_t
# if __WORDSIZE == 64
-# define ZBX_FS_UI64 "%lu"
-# define ZBX_FS_UO64 "%lo"
-# define ZBX_FS_UX64 "%lx"
-# define ZBX_OFFSET 10000000000000000UL
+# define ZBX_FS_UI64 "%lu"
+# define ZBX_FS_UO64 "%lo"
+# define ZBX_FS_UX64 "%lx"
# else
# ifdef HAVE_LONG_LONG_QU
-# define ZBX_FS_UI64 "%qu"
-# define ZBX_FS_UO64 "%qo"
-# define ZBX_FS_UX64 "%qx"
+# define ZBX_FS_UI64 "%qu"
+# define ZBX_FS_UO64 "%qo"
+# define ZBX_FS_UX64 "%qx"
# else
-# define ZBX_FS_UI64 "%llu"
-# define ZBX_FS_UO64 "%llo"
-# define ZBX_FS_UX64 "%llx"
+# define ZBX_FS_UI64 "%llu"
+# define ZBX_FS_UO64 "%llo"
+# define ZBX_FS_UX64 "%llx"
# endif
-# define ZBX_OFFSET 10000000000000000ULL
# endif
-#ifndef PATH_SEPARATOR
-# define PATH_SEPARATOR '/'
-#endif
+# ifndef PATH_SEPARATOR
+# define PATH_SEPARATOR '/'
+# endif
typedef off_t zbx_offset_t;
-#define zbx_lseek(fd, offset, whence) lseek(fd, (zbx_offset_t)(offset), whence)
+# define zbx_lseek(fd, offset, whence) lseek(fd, (zbx_offset_t)(offset), whence)
#endif /* _WINDOWS */