Last active
July 13, 2023 23:03
-
-
Save dbremner/c4725f83a5861e1fbcc56b2f5dca28e1 to your computer and use it in GitHub Desktop.
Macro for generating nullability typedefs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef NULLABILITY_TYPEDEFS_H | |
#define NULLABILITY_TYPEDEFS_H | |
#define MAKE_NULLABILITY_TYPEDEFS(type, name) \ | |
typedef const type *const _Nonnull name##_pure_ptr; \ | |
typedef const type *_Nonnull name##_const_ptr; \ | |
typedef type *_Nonnull name##_ptr; \ | |
typedef type *_Nullable name##_null_ptr; \ | |
typedef const type *const _Nullable name##_pure_null_ptr; \ | |
typedef type *_Nonnull *_Nonnull name##_ptr_ptr; \ | |
typedef type *_Nullable *_Nullable name##_null_ptr_ptr; | |
MAKE_NULLABILITY_TYPEDEFS(char, char) | |
MAKE_NULLABILITY_TYPEDEFS(struct timeval, timeval) | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment