OpenVPN
|
#include <stdint.h>
#include <windows.h>
Go to the source code of this file.
Macros | |
#define | PRIdS "Id" |
#define | PRIu64 "I64u" |
#define | PRIuMAX PRIu64 |
#define | PRIxMAX "I64x" |
#define | PRIXMAX "I64X" |
#define | SAFE_FREE(x) do { if ((x) != NULL) {free(x); x=NULL;} } while(0) |
Free memory space. More... | |
#define | ZERO_STRUCT(x) memset((char *)&(x), 0, sizeof(x)) |
Zero a structure. More... | |
#define | ZERO_STRUCTP(x) do { if ((x) != NULL) memset((char *)(x), 0, sizeof(*(x))); } while(0) |
Zero a structure given a pointer to the structure. More... | |
#define | ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0])) |
Get the size of an array. More... | |
#define | BURN_STRING(x) do { if ((x) != NULL) memset((x), 'X', strlen((x))); } while(0) |
Overwrite the complete string with 'X'. More... | |
#define | discard_const(ptr) ((void *)((uintptr_t)(ptr))) |
This is a hack to fix warnings. More... | |
#define | discard_const_p(type, ptr) ((type *)discard_const(ptr)) |
Type-safe version of discard_const. More... | |
Functions | |
WINBASEAPI BOOL WINAPI | IsDebuggerPresent (VOID) |
#define ARRAY_SIZE | ( | a | ) | (sizeof(a)/sizeof(a[0])) |
Get the size of an array.
Definition at line 139 of file cmocka_private.h.
Referenced by _run_test(), _test_free(), cmocka_run_one_test_or_fixture(), and exception_filter().
#define BURN_STRING | ( | x | ) | do { if ((x) != NULL) memset((x), 'X', strlen((x))); } while(0) |
Overwrite the complete string with 'X'.
Definition at line 142 of file cmocka_private.h.
#define discard_const | ( | ptr | ) | ((void *)((uintptr_t)(ptr))) |
This is a hack to fix warnings.
The idea is to use this everywhere that we get the "discarding const" warning by the compiler. That doesn't actually fix the real issue, but marks the place and you can search the code for discard_const.
Please use this macro only when there is no other way to fix the warning. We should use this function in only in a very few places.
Also, please call this via the discard_const_p() macro interface, as that makes the return type safe.
Definition at line 156 of file cmocka_private.h.
Referenced by _expect_not_string(), and _expect_string().
#define discard_const_p | ( | type, | |
ptr | |||
) | ((type *)discard_const(ptr)) |
Type-safe version of discard_const.
Definition at line 161 of file cmocka_private.h.
Referenced by _cmocka_run_group_tests(), _test_free(), and free_allocated_blocks().
#define PRIdS "Id" |
Definition at line 78 of file cmocka_private.h.
Referenced by _run_group_tests(), _run_tests(), cmprintf_group_finish_standard(), memory_equal_display_error(), and memory_not_equal_display_error().
#define PRIu64 "I64u" |
Definition at line 82 of file cmocka_private.h.
Referenced by _assert_return_code(), do_open_tun(), integer_in_range_display_error(), integer_not_in_range_display_error(), value_in_set_display_error(), and verify_auth_token().
#define PRIuMAX PRIu64 |
Definition at line 86 of file cmocka_private.h.
#define PRIxMAX "I64x" |
Definition at line 90 of file cmocka_private.h.
#define PRIXMAX "I64X" |
Definition at line 94 of file cmocka_private.h.
#define SAFE_FREE | ( | x | ) | do { if ((x) != NULL) {free(x); x=NULL;} } while(0) |
Free memory space.
Definition at line 130 of file cmocka_private.h.
#define ZERO_STRUCT | ( | x | ) | memset((char *)&(x), 0, sizeof(x)) |
Zero a structure.
Definition at line 133 of file cmocka_private.h.
#define ZERO_STRUCTP | ( | x | ) | do { if ((x) != NULL) memset((char *)(x), 0, sizeof(*(x))); } while(0) |
Zero a structure given a pointer to the structure.
Definition at line 136 of file cmocka_private.h.
WINBASEAPI BOOL WINAPI IsDebuggerPresent | ( | VOID | ) |
Referenced by _run_test(), and cmocka_run_one_test_or_fixture().