Changeset View
Changeset View
Standalone View
Standalone View
contrib/zstd/lib/common/mem.h
Show All 11 Lines | |||||
#if defined (__cplusplus) | #if defined (__cplusplus) | ||||
extern "C" { | extern "C" { | ||||
#endif | #endif | ||||
/*-**************************************** | /*-**************************************** | ||||
* Dependencies | * Dependencies | ||||
******************************************/ | ******************************************/ | ||||
#ifdef _KERNEL | |||||
#include <sys/param.h> /* size_t, ptrdiff_t */ | |||||
#include <sys/systm.h> /* memcpy */ | |||||
#else | |||||
#include <stddef.h> /* size_t, ptrdiff_t */ | #include <stddef.h> /* size_t, ptrdiff_t */ | ||||
#include <string.h> /* memcpy */ | #include <string.h> /* memcpy */ | ||||
#endif | |||||
/*-**************************************** | /*-**************************************** | ||||
* Compiler specifics | * Compiler specifics | ||||
******************************************/ | ******************************************/ | ||||
#if defined(_MSC_VER) /* Visual Studio */ | #if defined(_MSC_VER) /* Visual Studio */ | ||||
# include <stdlib.h> /* _byteswap_ulong */ | # include <stdlib.h> /* _byteswap_ulong */ | ||||
# include <intrin.h> /* _byteswap_* */ | # include <intrin.h> /* _byteswap_* */ | ||||
Show All 12 Lines | |||||
#define MEM_STATIC_ASSERT(c) { enum { MEM_static_assert = 1/(int)(!!(c)) }; } | #define MEM_STATIC_ASSERT(c) { enum { MEM_static_assert = 1/(int)(!!(c)) }; } | ||||
MEM_STATIC void MEM_check(void) { MEM_STATIC_ASSERT((sizeof(size_t)==4) || (sizeof(size_t)==8)); } | MEM_STATIC void MEM_check(void) { MEM_STATIC_ASSERT((sizeof(size_t)==4) || (sizeof(size_t)==8)); } | ||||
/*-************************************************************** | /*-************************************************************** | ||||
* Basic Types | * Basic Types | ||||
*****************************************************************/ | *****************************************************************/ | ||||
#if !defined (__VMS) && (defined (__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) ) | #if !defined (__VMS) && (defined (__cplusplus) || (defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) /* C99 */) ) | ||||
#ifndef _KERNEL | |||||
# include <stdint.h> | # include <stdint.h> | ||||
#endif | |||||
typedef uint8_t BYTE; | typedef uint8_t BYTE; | ||||
typedef uint16_t U16; | typedef uint16_t U16; | ||||
typedef int16_t S16; | typedef int16_t S16; | ||||
typedef uint32_t U32; | typedef uint32_t U32; | ||||
typedef int32_t S32; | typedef int32_t S32; | ||||
typedef uint64_t U64; | typedef uint64_t U64; | ||||
typedef int64_t S64; | typedef int64_t S64; | ||||
typedef intptr_t iPtrDiff; | typedef intptr_t iPtrDiff; | ||||
▲ Show 20 Lines • Show All 301 Lines • Show Last 20 Lines |