]> git.proxmox.com Git - libgit2.git/blob - src/util/win32/msvc-compat.h
New upstream version 1.5.0+ds
[libgit2.git] / src / util / win32 / msvc-compat.h
1 /*
2 * Copyright (C) the libgit2 contributors. All rights reserved.
3 *
4 * This file is part of libgit2, distributed under the GNU GPL v2 with
5 * a Linking Exception. For full terms see the included COPYING file.
6 */
7 #ifndef INCLUDE_win32_msvc_compat_h__
8 #define INCLUDE_win32_msvc_compat_h__
9
10 #if defined(_MSC_VER)
11
12 typedef unsigned short mode_t;
13 typedef SSIZE_T ssize_t;
14
15 #ifdef _WIN64
16 # define SSIZE_MAX _I64_MAX
17 #else
18 # define SSIZE_MAX LONG_MAX
19 #endif
20
21 #define strcasecmp(s1, s2) _stricmp(s1, s2)
22 #define strncasecmp(s1, s2, c) _strnicmp(s1, s2, c)
23
24 #endif
25
26 /*
27 * Offer GIT_LIBGIT2_CALL for our calling conventions (__cdecl, always).
28 * This is useful for providing callbacks to userspace code.
29 *
30 * Offer GIT_SYSTEM_CALL for the system calling conventions (__stdcall on
31 * Win32). Useful for providing callbacks to system libraries.
32 */
33 #define GIT_LIBGIT2_CALL __cdecl
34 #define GIT_SYSTEM_CALL NTAPI
35
36 #endif