Add padding to arena and test_func_result structs

This commit is contained in:
Abdelrahman Said 2024-06-09 17:40:41 +01:00
parent a0acada9b4
commit cd78913e83
2 changed files with 13 additions and 2 deletions

View File

@ -1,6 +1,7 @@
#include "mem_arena.h"
#include "aliases.h"
#include "mem_utils.h"
#include "misc_utils.h"
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
@ -18,6 +19,10 @@ struct arena {
u8 *offset;
u64 capacity;
bool committed;
#ifdef WAPP_PLATFORM_WINDOWS
wapp_misc_utils_padding_size(sizeof(u8 *) * 2 + sizeof(u64) + sizeof(bool));
#endif // ifdef WAPP_PLATFORM_WINDOWS
};
// PUBLIC API

View File

@ -1,20 +1,26 @@
#ifndef TESTER_H
#define TESTER_H
#include "misc_utils.h"
#include "platform.h"
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
#define wapp_tester_result(test_passed) \
((TestFuncResult){.name = __func__, .passed = test_passed})
#define wapp_tester_result(PASSED) \
((TestFuncResult){.name = __func__, .passed = PASSED})
#define wapp_tester_run_tests(...) run_tests(__VA_ARGS__, NULL)
typedef struct test_func_result TestFuncResult;
struct test_func_result {
const char *name;
bool passed;
#ifdef WAPP_PLATFORM_WINDOWS
wapp_misc_utils_padding_size(sizeof(const char *) + sizeof(bool));
#endif // WAPP_PLATFORM_WINDOWS
};
typedef TestFuncResult(TestFunc)(void);