Ver código fonte

liblzma: Avoid defining a 'restrict' macro

Any "#define restrict ..." line may conflict with MSVC header files
that use "__declspec(restrict)".  Define our own LZMA_RESTRICT macro
in "Utilities/cmliblzma/config.h.in" and transform liblzma code to
use it:

 git grep -lE '\<restrict\>' Utilities/cmliblzma/liblzma |
   xargs sed -i 's/\<restrict\>/LZMA_RESTRICT/g'
Brad King 11 anos atrás
pai
commit
73eab246fb
31 arquivos alterados com 103 adições e 101 exclusões
  1. 4 2
      Utilities/cmliblzma/config.h.in
  2. 3 3
      Utilities/cmliblzma/liblzma/common/alone_decoder.c
  3. 3 3
      Utilities/cmliblzma/liblzma/common/alone_encoder.c
  4. 3 3
      Utilities/cmliblzma/liblzma/common/auto_decoder.c
  5. 3 3
      Utilities/cmliblzma/liblzma/common/block_decoder.c
  6. 3 3
      Utilities/cmliblzma/liblzma/common/block_encoder.c
  7. 3 3
      Utilities/cmliblzma/liblzma/common/common.c
  8. 6 6
      Utilities/cmliblzma/liblzma/common/common.h
  9. 1 1
      Utilities/cmliblzma/liblzma/common/index.c
  10. 3 3
      Utilities/cmliblzma/liblzma/common/index_decoder.c
  11. 3 3
      Utilities/cmliblzma/liblzma/common/index_encoder.c
  12. 3 3
      Utilities/cmliblzma/liblzma/common/stream_decoder.c
  13. 3 3
      Utilities/cmliblzma/liblzma/common/stream_encoder.c
  14. 2 2
      Utilities/cmliblzma/liblzma/common/vli_decoder.c
  15. 1 1
      Utilities/cmliblzma/liblzma/common/vli_encoder.c
  16. 3 3
      Utilities/cmliblzma/liblzma/delta/delta_decoder.c
  17. 4 4
      Utilities/cmliblzma/liblzma/delta/delta_encoder.c
  18. 6 6
      Utilities/cmliblzma/liblzma/lz/lz_decoder.c
  19. 6 6
      Utilities/cmliblzma/liblzma/lz/lz_decoder.h
  20. 2 2
      Utilities/cmliblzma/liblzma/lz/lz_encoder.c
  21. 3 3
      Utilities/cmliblzma/liblzma/lz/lz_encoder.h
  22. 2 2
      Utilities/cmliblzma/liblzma/lzma/lzma2_decoder.c
  23. 2 2
      Utilities/cmliblzma/liblzma/lzma/lzma2_encoder.c
  24. 3 3
      Utilities/cmliblzma/liblzma/lzma/lzma_decoder.c
  25. 4 4
      Utilities/cmliblzma/liblzma/lzma/lzma_encoder.c
  26. 3 3
      Utilities/cmliblzma/liblzma/lzma/lzma_encoder.h
  27. 2 2
      Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_fast.c
  28. 6 6
      Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_normal.c
  29. 5 5
      Utilities/cmliblzma/liblzma/lzma/lzma_encoder_private.h
  30. 2 2
      Utilities/cmliblzma/liblzma/rangecoder/range_decoder.h
  31. 6 6
      Utilities/cmliblzma/liblzma/simple/simple_coder.c

+ 4 - 2
Utilities/cmliblzma/config.h.in

@@ -188,10 +188,12 @@ typedef uint64_t uintmax_t;
 
 #ifndef HAVE_RESTRICT
 #  ifdef HAVE___RESTRICT
-#    define restrict __restrict
+#    define LZMA_RESTRICT __restrict
 #  else
-#    define restrict
+#    define LZMA_RESTRICT
 #  endif
+#else
+#  define LZMA_RESTRICT restrict
 #endif /* HAVE_RESTRICT */
 
 #ifndef HAVE_INLINE

+ 3 - 3
Utilities/cmliblzma/liblzma/common/alone_decoder.c

@@ -52,9 +52,9 @@ struct lzma_coder_s {
 static lzma_ret
 alone_decode(lzma_coder *coder,
 		lzma_allocator *allocator lzma_attribute((__unused__)),
-		const uint8_t *restrict in, size_t *restrict in_pos,
-		size_t in_size, uint8_t *restrict out,
-		size_t *restrict out_pos, size_t out_size,
+		const uint8_t *LZMA_RESTRICT in, size_t *LZMA_RESTRICT in_pos,
+		size_t in_size, uint8_t *LZMA_RESTRICT out,
+		size_t *LZMA_RESTRICT out_pos, size_t out_size,
 		lzma_action action)
 {
 	while (*out_pos < out_size

+ 3 - 3
Utilities/cmliblzma/liblzma/common/alone_encoder.c

@@ -33,9 +33,9 @@ struct lzma_coder_s {
 static lzma_ret
 alone_encode(lzma_coder *coder,
 		lzma_allocator *allocator lzma_attribute((__unused__)),
-		const uint8_t *restrict in, size_t *restrict in_pos,
-		size_t in_size, uint8_t *restrict out,
-		size_t *restrict out_pos, size_t out_size,
+		const uint8_t *LZMA_RESTRICT in, size_t *LZMA_RESTRICT in_pos,
+		size_t in_size, uint8_t *LZMA_RESTRICT out,
+		size_t *LZMA_RESTRICT out_pos, size_t out_size,
 		lzma_action action)
 {
 	while (*out_pos < out_size)

+ 3 - 3
Utilities/cmliblzma/liblzma/common/auto_decoder.c

@@ -31,9 +31,9 @@ struct lzma_coder_s {
 
 static lzma_ret
 auto_decode(lzma_coder *coder, lzma_allocator *allocator,
-		const uint8_t *restrict in, size_t *restrict in_pos,
-		size_t in_size, uint8_t *restrict out,
-		size_t *restrict out_pos, size_t out_size, lzma_action action)
+		const uint8_t *LZMA_RESTRICT in, size_t *LZMA_RESTRICT in_pos,
+		size_t in_size, uint8_t *LZMA_RESTRICT out,
+		size_t *LZMA_RESTRICT out_pos, size_t out_size, lzma_action action)
 {
 	switch (coder->sequence) {
 	case SEQ_INIT:

+ 3 - 3
Utilities/cmliblzma/liblzma/common/block_decoder.c

@@ -72,9 +72,9 @@ is_size_valid(lzma_vli size, lzma_vli reference)
 
 static lzma_ret
 block_decode(lzma_coder *coder, lzma_allocator *allocator,
-		const uint8_t *restrict in, size_t *restrict in_pos,
-		size_t in_size, uint8_t *restrict out,
-		size_t *restrict out_pos, size_t out_size, lzma_action action)
+		const uint8_t *LZMA_RESTRICT in, size_t *LZMA_RESTRICT in_pos,
+		size_t in_size, uint8_t *LZMA_RESTRICT out,
+		size_t *LZMA_RESTRICT out_pos, size_t out_size, lzma_action action)
 {
 	switch (coder->sequence) {
 	case SEQ_CODE: {

+ 3 - 3
Utilities/cmliblzma/liblzma/common/block_encoder.c

@@ -46,9 +46,9 @@ struct lzma_coder_s {
 
 static lzma_ret
 block_encode(lzma_coder *coder, lzma_allocator *allocator,
-		const uint8_t *restrict in, size_t *restrict in_pos,
-		size_t in_size, uint8_t *restrict out,
-		size_t *restrict out_pos, size_t out_size, lzma_action action)
+		const uint8_t *LZMA_RESTRICT in, size_t *LZMA_RESTRICT in_pos,
+		size_t in_size, uint8_t *LZMA_RESTRICT out,
+		size_t *LZMA_RESTRICT out_pos, size_t out_size, lzma_action action)
 {
 	// Check that our amount of input stays in proper limits.
 	if (LZMA_VLI_MAX - coder->uncompressed_size < in_size - *in_pos)

+ 3 - 3
Utilities/cmliblzma/liblzma/common/common.c

@@ -70,9 +70,9 @@ lzma_free(void *ptr, lzma_allocator *allocator)
 //////////
 
 extern size_t
-lzma_bufcpy(const uint8_t *restrict in, size_t *restrict in_pos,
-		size_t in_size, uint8_t *restrict out,
-		size_t *restrict out_pos, size_t out_size)
+lzma_bufcpy(const uint8_t *LZMA_RESTRICT in, size_t *LZMA_RESTRICT in_pos,
+		size_t in_size, uint8_t *LZMA_RESTRICT out,
+		size_t *LZMA_RESTRICT out_pos, size_t out_size)
 {
 	const size_t in_avail = in_size - *in_pos;
 	const size_t out_avail = out_size - *out_pos;

+ 6 - 6
Utilities/cmliblzma/liblzma/common/common.h

@@ -88,9 +88,9 @@ typedef lzma_ret (*lzma_init_function)(
 /// function prototype.
 typedef lzma_ret (*lzma_code_function)(
 		lzma_coder *coder, lzma_allocator *allocator,
-		const uint8_t *restrict in, size_t *restrict in_pos,
-		size_t in_size, uint8_t *restrict out,
-		size_t *restrict out_pos, size_t out_size,
+		const uint8_t *LZMA_RESTRICT in, size_t *LZMA_RESTRICT in_pos,
+		size_t in_size, uint8_t *LZMA_RESTRICT out,
+		size_t *LZMA_RESTRICT out_pos, size_t out_size,
 		lzma_action action);
 
 /// Type of a function to free the memory allocated for the coder
@@ -234,9 +234,9 @@ extern void lzma_next_end(lzma_next_coder *next, lzma_allocator *allocator);
 
 /// Copy as much data as possible from in[] to out[] and update *in_pos
 /// and *out_pos accordingly. Returns the number of bytes copied.
-extern size_t lzma_bufcpy(const uint8_t *restrict in, size_t *restrict in_pos,
-		size_t in_size, uint8_t *restrict out,
-		size_t *restrict out_pos, size_t out_size);
+extern size_t lzma_bufcpy(const uint8_t *LZMA_RESTRICT in, size_t *LZMA_RESTRICT in_pos,
+		size_t in_size, uint8_t *LZMA_RESTRICT out,
+		size_t *LZMA_RESTRICT out_pos, size_t out_size);
 
 
 /// \brief      Return if expression doesn't evaluate to LZMA_OK

+ 1 - 1
Utilities/cmliblzma/liblzma/common/index.c

@@ -780,7 +780,7 @@ index_cat_helper(const index_cat_info *info, index_stream *this)
 
 
 extern LZMA_API(lzma_ret)
-lzma_index_cat(lzma_index *restrict dest, lzma_index *restrict src,
+lzma_index_cat(lzma_index *LZMA_RESTRICT dest, lzma_index *LZMA_RESTRICT src,
 		lzma_allocator *allocator)
 {
 	index_cat_info info;

+ 3 - 3
Utilities/cmliblzma/liblzma/common/index_decoder.c

@@ -55,10 +55,10 @@ struct lzma_coder_s {
 
 static lzma_ret
 index_decode(lzma_coder *coder, lzma_allocator *allocator,
-		const uint8_t *restrict in, size_t *restrict in_pos,
+		const uint8_t *LZMA_RESTRICT in, size_t *LZMA_RESTRICT in_pos,
 		size_t in_size,
-		uint8_t *restrict out lzma_attribute((__unused__)),
-		size_t *restrict out_pos lzma_attribute((__unused__)),
+		uint8_t *LZMA_RESTRICT out lzma_attribute((__unused__)),
+		size_t *LZMA_RESTRICT out_pos lzma_attribute((__unused__)),
 		size_t out_size lzma_attribute((__unused__)),
 		lzma_action action lzma_attribute((__unused__)))
 {

+ 3 - 3
Utilities/cmliblzma/liblzma/common/index_encoder.c

@@ -43,10 +43,10 @@ struct lzma_coder_s {
 static lzma_ret
 index_encode(lzma_coder *coder,
 		lzma_allocator *allocator lzma_attribute((__unused__)),
-		const uint8_t *restrict in lzma_attribute((__unused__)),
-		size_t *restrict in_pos lzma_attribute((__unused__)),
+		const uint8_t *LZMA_RESTRICT in lzma_attribute((__unused__)),
+		size_t *LZMA_RESTRICT in_pos lzma_attribute((__unused__)),
 		size_t in_size lzma_attribute((__unused__)),
-		uint8_t *restrict out, size_t *restrict out_pos,
+		uint8_t *LZMA_RESTRICT out, size_t *LZMA_RESTRICT out_pos,
 		size_t out_size,
 		lzma_action action lzma_attribute((__unused__)))
 {

+ 3 - 3
Utilities/cmliblzma/liblzma/common/stream_decoder.c

@@ -97,9 +97,9 @@ stream_decoder_reset(lzma_coder *coder, lzma_allocator *allocator)
 
 static lzma_ret
 stream_decode(lzma_coder *coder, lzma_allocator *allocator,
-		const uint8_t *restrict in, size_t *restrict in_pos,
-		size_t in_size, uint8_t *restrict out,
-		size_t *restrict out_pos, size_t out_size, lzma_action action)
+		const uint8_t *LZMA_RESTRICT in, size_t *LZMA_RESTRICT in_pos,
+		size_t in_size, uint8_t *LZMA_RESTRICT out,
+		size_t *LZMA_RESTRICT out_pos, size_t out_size, lzma_action action)
 {
 	// When decoding the actual Block, it may be able to produce more
 	// output even if we don't give it any new input.

+ 3 - 3
Utilities/cmliblzma/liblzma/common/stream_encoder.c

@@ -80,9 +80,9 @@ block_encoder_init(lzma_coder *coder, lzma_allocator *allocator)
 
 static lzma_ret
 stream_encode(lzma_coder *coder, lzma_allocator *allocator,
-		const uint8_t *restrict in, size_t *restrict in_pos,
-		size_t in_size, uint8_t *restrict out,
-		size_t *restrict out_pos, size_t out_size, lzma_action action)
+		const uint8_t *LZMA_RESTRICT in, size_t *LZMA_RESTRICT in_pos,
+		size_t in_size, uint8_t *LZMA_RESTRICT out,
+		size_t *LZMA_RESTRICT out_pos, size_t out_size, lzma_action action)
 {
 	// Main loop
 	while (*out_pos < out_size)

+ 2 - 2
Utilities/cmliblzma/liblzma/common/vli_decoder.c

@@ -14,8 +14,8 @@
 
 
 extern LZMA_API(lzma_ret)
-lzma_vli_decode(lzma_vli *restrict vli, size_t *vli_pos,
-		const uint8_t *restrict in, size_t *restrict in_pos,
+lzma_vli_decode(lzma_vli *LZMA_RESTRICT vli, size_t *vli_pos,
+		const uint8_t *LZMA_RESTRICT in, size_t *LZMA_RESTRICT in_pos,
 		size_t in_size)
 {
 	// If we haven't been given vli_pos, work in single-call mode.

+ 1 - 1
Utilities/cmliblzma/liblzma/common/vli_encoder.c

@@ -15,7 +15,7 @@
 
 extern LZMA_API(lzma_ret)
 lzma_vli_encode(lzma_vli vli, size_t *vli_pos,
-		uint8_t *restrict out, size_t *restrict out_pos,
+		uint8_t *LZMA_RESTRICT out, size_t *LZMA_RESTRICT out_pos,
 		size_t out_size)
 {
 	// If we haven't been given vli_pos, work in single-call mode.

+ 3 - 3
Utilities/cmliblzma/liblzma/delta/delta_decoder.c

@@ -29,9 +29,9 @@ decode_buffer(lzma_coder *coder, uint8_t *buffer, size_t size)
 
 static lzma_ret
 delta_decode(lzma_coder *coder, lzma_allocator *allocator,
-		const uint8_t *restrict in, size_t *restrict in_pos,
-		size_t in_size, uint8_t *restrict out,
-		size_t *restrict out_pos, size_t out_size, lzma_action action)
+		const uint8_t *LZMA_RESTRICT in, size_t *LZMA_RESTRICT in_pos,
+		size_t in_size, uint8_t *LZMA_RESTRICT out,
+		size_t *LZMA_RESTRICT out_pos, size_t out_size, lzma_action action)
 {
 	const size_t out_start = *out_pos;
 	lzma_ret ret;

+ 4 - 4
Utilities/cmliblzma/liblzma/delta/delta_encoder.c

@@ -19,7 +19,7 @@
 /// encoder's filter stack).
 static void
 copy_and_encode(lzma_coder *coder,
-		const uint8_t *restrict in, uint8_t *restrict out, size_t size)
+		const uint8_t *LZMA_RESTRICT in, uint8_t *LZMA_RESTRICT out, size_t size)
 {
 	size_t i;
 	const size_t distance = coder->distance;
@@ -52,9 +52,9 @@ encode_in_place(lzma_coder *coder, uint8_t *buffer, size_t size)
 
 static lzma_ret
 delta_encode(lzma_coder *coder, lzma_allocator *allocator,
-		const uint8_t *restrict in, size_t *restrict in_pos,
-		size_t in_size, uint8_t *restrict out,
-		size_t *restrict out_pos, size_t out_size, lzma_action action)
+		const uint8_t *LZMA_RESTRICT in, size_t *LZMA_RESTRICT in_pos,
+		size_t in_size, uint8_t *LZMA_RESTRICT out,
+		size_t *LZMA_RESTRICT out_pos, size_t out_size, lzma_action action)
 {
 	lzma_ret ret;
 

+ 6 - 6
Utilities/cmliblzma/liblzma/lz/lz_decoder.c

@@ -64,9 +64,9 @@ lz_decoder_reset(lzma_coder *coder)
 
 static lzma_ret
 decode_buffer(lzma_coder *coder,
-		const uint8_t *restrict in, size_t *restrict in_pos,
-		size_t in_size, uint8_t *restrict out,
-		size_t *restrict out_pos, size_t out_size)
+		const uint8_t *LZMA_RESTRICT in, size_t *LZMA_RESTRICT in_pos,
+		size_t in_size, uint8_t *LZMA_RESTRICT out,
+		size_t *LZMA_RESTRICT out_pos, size_t out_size)
 {
 	while (true) {
 		size_t copy_size;
@@ -131,9 +131,9 @@ decode_buffer(lzma_coder *coder,
 static lzma_ret
 lz_decode(lzma_coder *coder,
 		lzma_allocator *allocator lzma_attribute((__unused__)),
-		const uint8_t *restrict in, size_t *restrict in_pos,
-		size_t in_size, uint8_t *restrict out,
-		size_t *restrict out_pos, size_t out_size,
+		const uint8_t *LZMA_RESTRICT in, size_t *LZMA_RESTRICT in_pos,
+		size_t in_size, uint8_t *LZMA_RESTRICT out,
+		size_t *LZMA_RESTRICT out_pos, size_t out_size,
 		lzma_action action)
 {
 	if (coder->next.code == NULL)

+ 6 - 6
Utilities/cmliblzma/liblzma/lz/lz_decoder.h

@@ -56,9 +56,9 @@ typedef struct {
 	lzma_coder *coder;
 
 	/// Function to decode from in[] to *dict
-	lzma_ret (*code)(lzma_coder *restrict coder,
-			lzma_dict *restrict dict, const uint8_t *restrict in,
-			size_t *restrict in_pos, size_t in_size);
+	lzma_ret (*code)(lzma_coder *LZMA_RESTRICT coder,
+			lzma_dict *LZMA_RESTRICT dict, const uint8_t *LZMA_RESTRICT in,
+			size_t *LZMA_RESTRICT in_pos, size_t in_size);
 
 	void (*reset)(lzma_coder *coder, const void *options);
 
@@ -202,9 +202,9 @@ dict_put(lzma_dict *dict, uint8_t byte)
 
 /// Copies arbitrary amount of data into the dictionary.
 static inline void
-dict_write(lzma_dict *restrict dict, const uint8_t *restrict in,
-		size_t *restrict in_pos, size_t in_size,
-		size_t *restrict left)
+dict_write(lzma_dict *LZMA_RESTRICT dict, const uint8_t *LZMA_RESTRICT in,
+		size_t *LZMA_RESTRICT in_pos, size_t in_size,
+		size_t *LZMA_RESTRICT left)
 {
 	// NOTE: If we are being given more data than the size of the
 	// dictionary, it could be possible to optimize the LZ decoder

+ 2 - 2
Utilities/cmliblzma/liblzma/lz/lz_encoder.c

@@ -153,9 +153,9 @@ fill_window(lzma_coder *coder, lzma_allocator *allocator, const uint8_t *in,
 
 static lzma_ret
 lz_encode(lzma_coder *coder, lzma_allocator *allocator,
-		const uint8_t *restrict in, size_t *restrict in_pos,
+		const uint8_t *LZMA_RESTRICT in, size_t *LZMA_RESTRICT in_pos,
 		size_t in_size,
-		uint8_t *restrict out, size_t *restrict out_pos,
+		uint8_t *LZMA_RESTRICT out, size_t *LZMA_RESTRICT out_pos,
 		size_t out_size, lzma_action action)
 {
 	while (*out_pos < out_size

+ 3 - 3
Utilities/cmliblzma/liblzma/lz/lz_encoder.h

@@ -194,9 +194,9 @@ typedef struct {
 	lzma_coder *coder;
 
 	/// Function to encode from *dict to out[]
-	lzma_ret (*code)(lzma_coder *restrict coder,
-			lzma_mf *restrict mf, uint8_t *restrict out,
-			size_t *restrict out_pos, size_t out_size);
+	lzma_ret (*code)(lzma_coder *LZMA_RESTRICT coder,
+			lzma_mf *LZMA_RESTRICT mf, uint8_t *LZMA_RESTRICT out,
+			size_t *LZMA_RESTRICT out_pos, size_t out_size);
 
 	/// Free allocated resources
 	void (*end)(lzma_coder *coder, lzma_allocator *allocator);

+ 2 - 2
Utilities/cmliblzma/liblzma/lzma/lzma2_decoder.c

@@ -54,8 +54,8 @@ struct lzma_coder_s {
 
 
 static lzma_ret
-lzma2_decode(lzma_coder *restrict coder, lzma_dict *restrict dict,
-		const uint8_t *restrict in, size_t *restrict in_pos,
+lzma2_decode(lzma_coder *LZMA_RESTRICT coder, lzma_dict *LZMA_RESTRICT dict,
+		const uint8_t *LZMA_RESTRICT in, size_t *LZMA_RESTRICT in_pos,
 		size_t in_size)
 {
 	// With SEQ_LZMA it is possible that no new input is needed to do

+ 2 - 2
Utilities/cmliblzma/liblzma/lzma/lzma2_encoder.c

@@ -134,8 +134,8 @@ lzma2_header_uncompressed(lzma_coder *coder)
 
 
 static lzma_ret
-lzma2_encode(lzma_coder *restrict coder, lzma_mf *restrict mf,
-		uint8_t *restrict out, size_t *restrict out_pos,
+lzma2_encode(lzma_coder *LZMA_RESTRICT coder, lzma_mf *LZMA_RESTRICT mf,
+		uint8_t *LZMA_RESTRICT out, size_t *LZMA_RESTRICT out_pos,
 		size_t out_size)
 {
 	while (*out_pos < out_size)

+ 3 - 3
Utilities/cmliblzma/liblzma/lzma/lzma_decoder.c

@@ -281,9 +281,9 @@ struct lzma_coder_s {
 
 
 static lzma_ret
-lzma_decode(lzma_coder *restrict coder, lzma_dict *restrict dictptr,
-		const uint8_t *restrict in,
-		size_t *restrict in_pos, size_t in_size)
+lzma_decode(lzma_coder *LZMA_RESTRICT coder, lzma_dict *LZMA_RESTRICT dictptr,
+		const uint8_t *LZMA_RESTRICT in,
+		size_t *LZMA_RESTRICT in_pos, size_t in_size)
 {
 	///////////////
 	// Variables //

+ 4 - 4
Utilities/cmliblzma/liblzma/lzma/lzma_encoder.c

@@ -318,8 +318,8 @@ encode_eopm(lzma_coder *coder, uint32_t position)
 
 
 extern lzma_ret
-lzma_lzma_encode(lzma_coder *restrict coder, lzma_mf *restrict mf,
-		uint8_t *restrict out, size_t *restrict out_pos,
+lzma_lzma_encode(lzma_coder *LZMA_RESTRICT coder, lzma_mf *LZMA_RESTRICT mf,
+		uint8_t *LZMA_RESTRICT out, size_t *LZMA_RESTRICT out_pos,
 		size_t out_size, uint32_t limit)
 {
 	uint32_t position;
@@ -414,8 +414,8 @@ lzma_lzma_encode(lzma_coder *restrict coder, lzma_mf *restrict mf,
 
 
 static lzma_ret
-lzma_encode(lzma_coder *restrict coder, lzma_mf *restrict mf,
-		uint8_t *restrict out, size_t *restrict out_pos,
+lzma_encode(lzma_coder *LZMA_RESTRICT coder, lzma_mf *LZMA_RESTRICT mf,
+		uint8_t *LZMA_RESTRICT out, size_t *LZMA_RESTRICT out_pos,
 		size_t out_size)
 {
 	// Plain LZMA has no support for sync-flushing.

+ 3 - 3
Utilities/cmliblzma/liblzma/lzma/lzma_encoder.h

@@ -44,9 +44,9 @@ extern lzma_ret lzma_lzma_encoder_reset(
 		lzma_coder *coder, const lzma_options_lzma *options);
 
 
-extern lzma_ret lzma_lzma_encode(lzma_coder *restrict coder,
-		lzma_mf *restrict mf, uint8_t *restrict out,
-		size_t *restrict out_pos, size_t out_size,
+extern lzma_ret lzma_lzma_encode(lzma_coder *LZMA_RESTRICT coder,
+		lzma_mf *LZMA_RESTRICT mf, uint8_t *LZMA_RESTRICT out,
+		size_t *LZMA_RESTRICT out_pos, size_t out_size,
 		uint32_t read_limit);
 
 #endif

+ 2 - 2
Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_fast.c

@@ -17,8 +17,8 @@
 
 
 extern void
-lzma_lzma_optimum_fast(lzma_coder *restrict coder, lzma_mf *restrict mf,
-		uint32_t *restrict back_res, uint32_t *restrict len_res)
+lzma_lzma_optimum_fast(lzma_coder *LZMA_RESTRICT coder, lzma_mf *LZMA_RESTRICT mf,
+		uint32_t *LZMA_RESTRICT back_res, uint32_t *LZMA_RESTRICT len_res)
 {
 	const uint8_t *buf;
 	uint32_t buf_avail;

+ 6 - 6
Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_normal.c

@@ -230,8 +230,8 @@ make_short_rep(lzma_optimal *optimal)
 
 
 static void
-backward(lzma_coder *restrict coder, uint32_t *restrict len_res,
-		uint32_t *restrict back_res, uint32_t cur)
+backward(lzma_coder *LZMA_RESTRICT coder, uint32_t *LZMA_RESTRICT len_res,
+		uint32_t *LZMA_RESTRICT back_res, uint32_t cur)
 {
 	uint32_t pos_mem = coder->opts[cur].pos_prev;
 	uint32_t back_mem = coder->opts[cur].back_prev;
@@ -278,8 +278,8 @@ backward(lzma_coder *restrict coder, uint32_t *restrict len_res,
 //////////
 
 static inline uint32_t
-helper1(lzma_coder *restrict coder, lzma_mf *restrict mf,
-		uint32_t *restrict back_res, uint32_t *restrict len_res,
+helper1(lzma_coder *LZMA_RESTRICT coder, lzma_mf *LZMA_RESTRICT mf,
+		uint32_t *LZMA_RESTRICT back_res, uint32_t *LZMA_RESTRICT len_res,
 		uint32_t position)
 {
 	uint32_t buf_avail;
@@ -865,8 +865,8 @@ helper2(lzma_coder *coder, uint32_t *reps, const uint8_t *buf,
 
 
 extern void
-lzma_lzma_optimum_normal(lzma_coder *restrict coder, lzma_mf *restrict mf,
-		uint32_t *restrict back_res, uint32_t *restrict len_res,
+lzma_lzma_optimum_normal(lzma_coder *LZMA_RESTRICT coder, lzma_mf *LZMA_RESTRICT mf,
+		uint32_t *LZMA_RESTRICT back_res, uint32_t *LZMA_RESTRICT len_res,
 		uint32_t position)
 {
 	uint32_t reps[REP_DISTANCES];

+ 5 - 5
Utilities/cmliblzma/liblzma/lzma/lzma_encoder_private.h

@@ -138,11 +138,11 @@ struct lzma_coder_s {
 
 
 extern void lzma_lzma_optimum_fast(
-		lzma_coder *restrict coder, lzma_mf *restrict mf,
-		uint32_t *restrict back_res, uint32_t *restrict len_res);
+		lzma_coder *LZMA_RESTRICT coder, lzma_mf *LZMA_RESTRICT mf,
+		uint32_t *LZMA_RESTRICT back_res, uint32_t *LZMA_RESTRICT len_res);
 
-extern void lzma_lzma_optimum_normal(lzma_coder *restrict coder,
-		lzma_mf *restrict mf, uint32_t *restrict back_res,
-		uint32_t *restrict len_res, uint32_t position);
+extern void lzma_lzma_optimum_normal(lzma_coder *LZMA_RESTRICT coder,
+		lzma_mf *LZMA_RESTRICT mf, uint32_t *LZMA_RESTRICT back_res,
+		uint32_t *LZMA_RESTRICT len_res, uint32_t position);
 
 #endif

+ 2 - 2
Utilities/cmliblzma/liblzma/rangecoder/range_decoder.h

@@ -26,8 +26,8 @@ typedef struct {
 
 /// Reads the first five bytes to initialize the range decoder.
 static inline bool
-rc_read_init(lzma_range_decoder *rc, const uint8_t *restrict in,
-		size_t *restrict in_pos, size_t in_size)
+rc_read_init(lzma_range_decoder *rc, const uint8_t *LZMA_RESTRICT in,
+		size_t *LZMA_RESTRICT in_pos, size_t in_size)
 {
 	while (rc->init_bytes_left > 0) {
 		if (*in_pos == in_size)

+ 6 - 6
Utilities/cmliblzma/liblzma/simple/simple_coder.c

@@ -19,9 +19,9 @@
 /// Copied or encodes/decodes more data to out[].
 static lzma_ret
 copy_or_code(lzma_coder *coder, lzma_allocator *allocator,
-		const uint8_t *restrict in, size_t *restrict in_pos,
-		size_t in_size, uint8_t *restrict out,
-		size_t *restrict out_pos, size_t out_size, lzma_action action)
+		const uint8_t *LZMA_RESTRICT in, size_t *LZMA_RESTRICT in_pos,
+		size_t in_size, uint8_t *LZMA_RESTRICT out,
+		size_t *LZMA_RESTRICT out_pos, size_t out_size, lzma_action action)
 {
 	assert(!coder->end_was_reached);
 
@@ -67,9 +67,9 @@ call_filter(lzma_coder *coder, uint8_t *buffer, size_t size)
 
 static lzma_ret
 simple_code(lzma_coder *coder, lzma_allocator *allocator,
-		const uint8_t *restrict in, size_t *restrict in_pos,
-		size_t in_size, uint8_t *restrict out,
-		size_t *restrict out_pos, size_t out_size, lzma_action action)
+		const uint8_t *LZMA_RESTRICT in, size_t *LZMA_RESTRICT in_pos,
+		size_t in_size, uint8_t *LZMA_RESTRICT out,
+		size_t *LZMA_RESTRICT out_pos, size_t out_size, lzma_action action)
 {
 	size_t out_avail;
 	size_t buf_avail;