summaryrefslogtreecommitdiff
path: root/liblzma/api/lzma.h
diff options
context:
space:
mode:
authorliblzma upstream <xz-devel@tukaani.org>2018-04-29 19:00:06 +0300
committerBrad King <brad.king@kitware.com>2018-08-06 10:24:54 -0400
commit352b8fa70d18ff1664cd8b22f42cf980a976ae4d (patch)
tree4f1267f96f542178e35ae60f0f27ef19a2b341ac /liblzma/api/lzma.h
parent897b790d57f9c114adf1e0374b4a004ba6a8ec99 (diff)
downloadcmake-352b8fa70d18ff1664cd8b22f42cf980a976ae4d.tar.gz
liblzma 2018-04-29 (b5be61cc)
Code extracted from: https://git.tukaani.org/xz.git at commit b5be61cc06088bb07f488f9baf7d447ff47b37c1 (v5.2.4).
Diffstat (limited to 'liblzma/api/lzma.h')
-rw-r--r--liblzma/api/lzma.h26
1 files changed, 19 insertions, 7 deletions
diff --git a/liblzma/api/lzma.h b/liblzma/api/lzma.h
index fb874c3e13..aa88e4243a 100644
--- a/liblzma/api/lzma.h
+++ b/liblzma/api/lzma.h
@@ -82,12 +82,20 @@
# if !defined(UINT32_C) || !defined(UINT64_C) \
|| !defined(UINT32_MAX) || !defined(UINT64_MAX)
/*
- * MSVC has no C99 support, and thus it cannot be used to
- * compile liblzma. The liblzma API has to still be usable
- * from MSVC, so we need to define the required standard
- * integer types here.
+ * MSVC versions older than 2013 have no C99 support, and
+ * thus they cannot be used to compile liblzma. Using an
+ * existing liblzma.dll with old MSVC can work though(*),
+ * but we need to define the required standard integer
+ * types here in a MSVC-specific way.
+ *
+ * (*) If you do this, the existing liblzma.dll probably uses
+ * a different runtime library than your MSVC-built
+ * application. Mixing runtimes is generally bad, but
+ * in this case it should work as long as you avoid
+ * the few rarely-needed liblzma functions that allocate
+ * memory and expect the caller to free it using free().
*/
-# if defined(_WIN32) && defined(_MSC_VER)
+# if defined(_WIN32) && defined(_MSC_VER) && _MSC_VER < 1800
typedef unsigned __int8 uint8_t;
typedef unsigned __int32 uint32_t;
typedef unsigned __int64 uint64_t;
@@ -211,7 +219,11 @@
*/
#ifndef lzma_nothrow
# if defined(__cplusplus)
-# define lzma_nothrow throw()
+# if __cplusplus >= 201103L
+# define lzma_nothrow noexcept
+# else
+# define lzma_nothrow throw()
+# endif
# elif __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
# define lzma_nothrow __attribute__((__nothrow__))
# else
@@ -286,7 +298,7 @@ extern "C" {
#include "lzma/filter.h"
#include "lzma/bcj.h"
#include "lzma/delta.h"
-#include "lzma/lzma.h"
+#include "lzma/lzma12.h"
/* Container formats */
#include "lzma/container.h"