Add compatibility to MS Visual C
[git/wgit.git] / compat / msvc.h
blobdccb40b057976c9b6e5d6f0f187409e08785be65
1 #ifndef GIT_COMPAT_MSVC_H
2 #define GIT_COMPAT_MSVC_H
4 #if !defined(_MSC_VER) || (_MSC_VER < 1400)
5 # error You need at least Visual Studio 2005
6 #endif
8 #define inline __inline
9 #define va_copy(d, s) do { (d) = (s); } while(0)
11 #define SHA1_HEADER "mozilla-sha1/sha1.h"
13 #define NO_OPENSSL
14 #define NO_ICONV
16 #define NO_MKDTEMP /* support for this may be added later */
17 #define NO_STRCASESTR
18 #define NO_STRLCPY
19 #define NO_STRTOUMAX
20 #define NO_MEMMEM
21 #define INTERNAL_QSORT /* use internal qsort to benefit from ltcg */
23 #include <gitversion.h>
25 #define GIT_EXEC_PATH msvc_get_exec_path()
26 #define ETC_GITCONFIG msvc_get_etc_gitconfig()
27 #define GIT_MAN_PATH msvc_get_man_path()
28 #define GIT_INFO_PATH msvc_get_info_path()
29 #define GIT_HTML_PATH msvc_get_html_path()
30 #define DEFAULT_GIT_TEMPLATE_DIR msvc_get_template_path()
31 #define GIT_USER_AGENT "git/" GIT_VERSION
33 const char *msvc_get_exec_path();
34 const char *msvc_get_etc_gitconfig(); /* GIT_EXEC_PATH "/etc/gitconfig" */
35 const char *msvc_get_man_path(); /* GIT_EXEC_PATH "/man" */
36 const char *msvc_get_info_path(); /* GIT_EXEC_PATH "/info" */
37 const char *msvc_get_html_path(); /* GIT_EXEC_PATH "/html" */
38 const char *msvc_get_template_path(); /* GIT_EXEC_PATH "/template" */
40 #define has_dos_drive_prefix(path) (isalpha(path[0]) && path[1] == ':')
41 #define is_dir_sep(c) (c == '/' || c == '\\')
42 #define PATH_SEP ';'
44 #endif /* GIT_COMPAT_MSVC_H */