mirror of
				https://github.com/webmproject/libwebp.git
				synced 2025-10-30 18:05:36 +01:00 
			
		
		
		
	define WEBP_RESTRICT for MSVC
__restrict is supported: https://docs.microsoft.com/en-us/cpp/cpp/extension-restrict?view=msvc-160 + add a comment and simplify the __restrict__ check, clang defines __GNUC__ Change-Id: I76d8d3cbd1b730f492c6fc0b2114f1897886b677
This commit is contained in:
		| @@ -25,20 +25,27 @@ | |||||||
| #include "src/dsp/dsp.h" | #include "src/dsp/dsp.h" | ||||||
| #include "src/webp/types.h" | #include "src/webp/types.h" | ||||||
|  |  | ||||||
| //------------------------------------------------------------------------------ | #ifdef __cplusplus | ||||||
| // restrict | extern "C" { | ||||||
|  | #endif | ||||||
|  |  | ||||||
| #if defined(__GNUC__) || defined(__clang__) | //------------------------------------------------------------------------------ | ||||||
|  | // WEBP_RESTRICT | ||||||
|  |  | ||||||
|  | // Declares a pointer with the restrict type qualifier if available. | ||||||
|  | // This allows code to hint to the compiler that only this pointer references a | ||||||
|  | // particular object or memory region within the scope of the block in which it | ||||||
|  | // is declared. This may allow for improved optimizations due to the lack of | ||||||
|  | // pointer aliasing. See also: | ||||||
|  | // https://en.cppreference.com/w/c/language/restrict | ||||||
|  | #if defined(__GNUC__) | ||||||
|  | #define WEBP_RESTRICT __restrict__ | ||||||
|  | #elif defined(_MSC_VER) | ||||||
| #define WEBP_RESTRICT __restrict | #define WEBP_RESTRICT __restrict | ||||||
| #else | #else | ||||||
| #define WEBP_RESTRICT | #define WEBP_RESTRICT | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
|  |  | ||||||
| #ifdef __cplusplus |  | ||||||
| extern "C" { |  | ||||||
| #endif |  | ||||||
|  |  | ||||||
| //------------------------------------------------------------------------------ | //------------------------------------------------------------------------------ | ||||||
| // Memory allocation | // Memory allocation | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user