Browse Source

common: netadr: use static_assert macro

pull/2/head
Alibek Omarov 2 years ago
parent
commit
e30c61c0e2
  1. 4
      common/netadr.h

4
common/netadr.h

@ -31,8 +31,6 @@ typedef enum
NA_MULTICAST_IP6, // all nodes multicast NA_MULTICAST_IP6, // all nodes multicast
} netadrtype_t; } netadrtype_t;
#define NETADR_T_SIZE 20
// Original structure: // Original structure:
// typedef struct netadr_s // typedef struct netadr_s
// { // {
@ -73,6 +71,6 @@ typedef struct netadr_s
} netadr_t; } netadr_t;
#pragma pack( pop ) #pragma pack( pop )
extern int _check_netadr_t_size[sizeof( netadr_t ) == NETADR_T_SIZE ? 1 : -1]; STATIC_ASSERT( sizeof( netadr_t ) == 20, "invalid netadr_t size" );
#endif//NETADR_H #endif//NETADR_H

Loading…
Cancel
Save