mirror of
https://git.sr.ht/~thestr4ng3r/chiaki
synced 2025-08-21 14:03:11 -07:00
Fix some Alignment Issues
This commit is contained in:
parent
2cbcc266c3
commit
4065791f4f
8 changed files with 92 additions and 75 deletions
|
@ -25,11 +25,20 @@
|
|||
#endif
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
typedef uint32_t chiaki_unaligned_uint32_t __attribute__((aligned(1)));
|
||||
typedef uint16_t chiaki_unaligned_uint16_t __attribute__((aligned(1)));
|
||||
#else
|
||||
typedef uint32_t chiaki_unaligned_uint32_t;
|
||||
typedef uint16_t chiaki_unaligned_uint16_t;
|
||||
#endif
|
||||
|
||||
#define CHIAKI_EXPORT
|
||||
|
||||
#define CHIAKI_NEW(t) ((t*)malloc(sizeof(t)))
|
||||
|
|
|
@ -48,7 +48,12 @@ typedef struct chiaki_ctrl_t
|
|||
bool login_pin_requested;
|
||||
|
||||
chiaki_socket_t sock;
|
||||
|
||||
#ifdef __GNUC__
|
||||
__attribute__((aligned(__alignof__(uint32_t))))
|
||||
#endif
|
||||
uint8_t recv_buf[512];
|
||||
|
||||
size_t recv_buf_size;
|
||||
uint64_t crypt_counter_local;
|
||||
uint64_t crypt_counter_remote;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue