removed PACK() macro

This commit is contained in:
timerix 2022-08-14 14:29:03 +06:00
parent 171d5c4763
commit 7213a361b2
4 changed files with 6 additions and 8 deletions

View File

@ -10,9 +10,9 @@ extern "C" {
#define KNPAC_MAX_DATA_SIZE (65535-sizeof(knPackage)+sizeof(uint8*))
typedef enum knPacVersion PACK({
typedef enum __attribute__((__packed__)) knPacVersion {
knPac_V1
}) knPacVersion;
} knPacVersion;
static const char knPacHeader[5]={'k','n','p','a','c'};

View File

@ -9,9 +9,9 @@ extern "C" {
#include "knPackage.h"
typedef enum knSocketType PACK({
typedef enum __attribute__((__packed__)) knSocketType {
knSocketType_TCP, knSocketType_UDP
}) knSocketType;
} knSocketType;
typedef struct knSocket {
knSocketType type;

View File

@ -50,8 +50,6 @@ extern "C" {
#endif
#define PACK(...) __VA_ARGS__ __attribute__((__packed__))
#if __cplusplus
}
#endif

View File

@ -16,7 +16,7 @@ typedef int64_t int64;
typedef uint64_t uint64;
typedef float float32;
typedef double float64;
typedef enum my_type PACK({
typedef enum __attribute__((__packed__)) my_type {
Null, Float32, Float64, Char, Bool,
UInt8, Int8, UInt16, Int16, UInt32, Int32, UInt64, Int64,
UInt8Ptr, Int8Ptr, UInt16Ptr, Int16Ptr, UInt32Ptr, Int32Ptr, UInt64Ptr, Int64Ptr,
@ -25,7 +25,7 @@ typedef enum my_type PACK({
AutoarrInt8Ptr, AutoarrUInt8Ptr, AutoarrInt16Ptr, AutoarrUInt16Ptr,
AutoarrInt32Ptr, AutoarrUInt32Ptr, AutoarrInt64Ptr, AutoarrUInt64Ptr,
AutoarrUnitypePtr, AutoarrKVPairPtr, knSocketPtr
}) my_type;
} my_type;
#define my_type_last knSocketPtr
const char* my_type_name(my_type t);