Files
cKit/Base/c_Compiler.h
T

46 lines
1.1 KiB
C
Raw Normal View History

2026-08-29 00:53:40 +08:00
#ifndef INCLUDED_C_COMPILER_H
#define INCLUDED_C_COMPILER_H
#ifndef INCLUDED_C_PLATFORM_H
#include <c_Platform.h>
#endif /*INCLUDED_C_PLATFORM_H*/
/* ------------------------------------------------------------------------------------------------------------------ */
/* C_PACKED 举例 */
/*
C_PACKED_STRUCT_START
struct MyHeader {
char id;
int length;
} C_PACKED;
C_PACKED_STRUCT_END
*/
/* ------------------------------------------------------------------------------------------------------------------ */
/* */
#if (C_IS_COMPILER_GCC)
#include "c_Compiler_GCC.h"
#elif (C_IS_COMPILER_CLANG)
#include "c_Compiler_CLANG.h"
#elif (C_IS_COMPILER_MSVC)
#include "c_Compiler_MSVC.h"
#else
#define C_INLINE inline
#define C_NOINLINE
#define C_STATIC_FORCE_INLINE static C_INLINE
#define C_PACKED_STRUCT_START
#define C_PACKED_STRUCT_END
#define C_PACKED
#define C_ALIGN(bytes)
#define C_RESTRICT restrict
#define C_LIKELY(x) (x)
#define C_UNLIKELY(x) (x)
#endif
#define C_UNUSED(x) ((void)(x))
#endif /*INCLUDED_C_COMPILER_H*/