diff options
Diffstat (limited to 'lib/memory.h')
| -rw-r--r-- | lib/memory.h | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/lib/memory.h b/lib/memory.h index 1a0269f8bb..91a02b7966 100644 --- a/lib/memory.h +++ b/lib/memory.h @@ -22,6 +22,10 @@ #include <frratomic.h> #include "compiler.h" +#ifdef __cplusplus +extern "C" { +#endif + #define array_size(ar) (sizeof(ar) / sizeof(ar[0])) #if defined(HAVE_MALLOC_SIZE) && !defined(HAVE_MALLOC_USABLE_SIZE) @@ -33,12 +37,12 @@ struct memtype { struct memtype *next, **ref; const char *name; - _Atomic size_t n_alloc; - _Atomic size_t n_max; - _Atomic size_t size; + atomic_size_t n_alloc; + atomic_size_t n_max; + atomic_size_t size; #ifdef HAVE_MALLOC_USABLE_SIZE - _Atomic size_t total; - _Atomic size_t max_size; + atomic_size_t total; + atomic_size_t max_size; #endif }; @@ -176,4 +180,8 @@ extern int log_memstats(FILE *fp, const char *); extern void memory_oom(size_t size, const char *name); +#ifdef __cplusplus +} +#endif + #endif /* _QUAGGA_MEMORY_H */ |
