summaryrefslogtreecommitdiff
path: root/examples/common.h
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2019-04-16 10:56:18 +0200
committerPatrick Steinhardt <ps@pks.im>2019-04-16 11:52:30 +0200
commitb106620d038bc764329a29c234ffad5903479634 (patch)
tree02d60a0b955c60451930b33f6821a257d1a273e3 /examples/common.h
parentd1cfd79a477a440c5f0929c34e817da202227ec7 (diff)
downloadlibgit2-b106620d038bc764329a29c234ffad5903479634.tar.gz
examples: move MSVC compatibility macros into common header
We currently have two locations in our examples where we define the same compatibility wrappers for MSVC. Move them into "common.h" to avoid duplication and make them available to other examples.
Diffstat (limited to 'examples/common.h')
-rw-r--r--examples/common.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/examples/common.h b/examples/common.h
index ac1c067dd..c1d444e1d 100644
--- a/examples/common.h
+++ b/examples/common.h
@@ -26,6 +26,11 @@
#endif
#endif
+#ifdef _MSC_VER
+#define snprintf sprintf_s
+#define strcasecmp strcmpi
+#endif
+
#define ARRAY_SIZE(x) (sizeof(x)/sizeof(*x))
#define UNUSED(x) (void)(x)