27#ifndef _ACFUTILS_CORE_H_
28#define _ACFUTILS_CORE_H_
75#if __STDC_VERSION__ >= 202311L
77#define UNUSED_ATTR [[maybe_unused]]
78#define WARN_UNUSED_RES_ATTR [[nodiscard]]
79#define DEPRECATED_ATTR [[deprecated]]
81#elif defined(__GNUC__) || defined(__clang__)
83#define UNUSED_ATTR __attribute__((unused))
84#define WARN_UNUSED_RES_ATTR __attribute__((warn_unused_result))
85#define DEPRECATED_ATTR __attribute__((deprecated))
87#if IBM && defined(__GNUC__) && __GNUC__ < 11
88#define PACKED_ATTR __attribute__((__packed__, gcc_struct))
90#define PACKED_ATTR __attribute__((__packed__))
96#define WARN_UNUSED_RES_ATTR
98#define DEPRECATED_ATTR
103#define UNUSED(x) (void)(x)
106#define LACF_UNUSED(x) (void)(x)
108#if __STDC_VERSION__ >= 202311L
109#define NODISCARD [[nodiscard]]
110#define NODISCARD_R(reason) [[nodiscard(reason)]]
112#define NODISCARD WARN_UNUSED_RES_ATTR
113#define NODISCARD_R(reason) WARN_UNUSED_RES_ATTR
116#define ACFSYM(__sym__) __libacfutils_ ## __sym__
118#if IBM && (!defined(__MINGW32__) || defined(ACFUTILS_DLL))
119#define API_EXPORT __declspec(dllexport)
121#define API_EXPORT_DATA __declspec(dllexport) extern
123#define API_EXPORT_DATA __declspec(dllimport) extern
127#define API_EXPORT_DATA extern
132# if defined(_MSC_VER)
133# define restrict __restrict
135# define restrict __restrict__
138#elif __STDC_VERSION__ < 199901L
140# if defined(__GNUC__) || defined(__clang__) || defined(_MSC_VER)
141# define restrict __restrict
147# if defined(_MSC_VER)
148# define inline __inline
158#define LACF_DESTROY(ptr) \
160 if ((ptr) != NULL) { \
171#define ARRAY_NUM_ELEM(_array) (sizeof (_array) / sizeof (*(_array)))
void lacf_free(void *buf)
const char * libacfutils_version
void * lacf_malloc(size_t n)