rsys

Basic data structures and low-level features
git clone git://git.meso-star.fr/rsys.git
Log | Files | Refs | README | LICENSE

commit e46832654dcb040483b9545b7ceb9b7cbf0c4aa1
parent bdf283f2af6bf4b852c06969598df43417172962
Author: vaplv <vaplv@free.fr>
Date:   Mon, 24 Feb 2014 22:06:31 +0100

Replace the explicit extern "C" block by DECLS macros

Diffstat:
Msrc/clock_time.h | 8++------
Msrc/image.h | 8++------
Msrc/library.h | 8++------
Msrc/mem_allocator.h | 10++++------
Msrc/mutex.h | 8++------
Msrc/str.h | 8++------
6 files changed, 14 insertions(+), 36 deletions(-)

diff --git a/src/clock_time.h b/src/clock_time.h @@ -19,9 +19,7 @@ enum time_unit { TIME_DAY = BIT(6) }; -#ifdef __cplusplus -extern "C" { -#endif +BEGIN_DECLS RSYS_API void time_current @@ -52,9 +50,7 @@ time_dump char* dump, /* May be NULL. */ size_t max_dump_len); -#ifdef __cplusplus -} /* extern C */ -#endif +END_DECLS #endif /* TIME_H */ diff --git a/src/image.h b/src/image.h @@ -3,9 +3,7 @@ #include "rsys.h" -#ifdef __cplusplus -extern "C" { -#endif +BEGIN_DECLS RSYS_API int image_ppm_write @@ -15,9 +13,7 @@ image_ppm_write int bytes_per_pixel, const unsigned char* buffer); -#ifdef __cplusplus -} /* extern "C" */ -#endif +END_DECLS #endif /* IMAGE_H */ diff --git a/src/library.h b/src/library.h @@ -3,9 +3,7 @@ #include "rsys.h" -#ifdef __cplusplus -extern "C" { -#endif +BEGIN_DECLS RSYS_API void* /* Library handle */ library_open @@ -20,9 +18,7 @@ RSYS_API int library_close (void* handle); -#ifdef __cplusplus -} /* extern "C" */ -#endif +END_DECLS #endif /* LIBRARY_H */ diff --git a/src/mem_allocator.h b/src/mem_allocator.h @@ -85,12 +85,12 @@ extern struct mem_allocator mem_default_allocator; #define MEM_DUMP(Allocator, Msg, MaxLen) \ ((Allocator)->dump((Allocator)->data, (Msg), (MaxLen))) -#ifdef __cplusplus -extern "C" { -#endif + /******************************************************************************* * Regular allocation functions ******************************************************************************/ +BEGIN_DECLS + RSYS_API void* mem_alloc(const size_t size); RSYS_API void* mem_calloc(const size_t nelmts, const size_t size); RSYS_API void* mem_realloc(void* ptr, const size_t size); @@ -111,9 +111,7 @@ RSYS_API void mem_shutdown_proxy_allocator (struct mem_allocator* proxy_allocator); -#ifdef __cplusplus -} /* extern "C" */ -#endif +END_DECLS #endif /* MEM_ALLOCATOR_H */ diff --git a/src/mutex.h b/src/mutex.h @@ -3,9 +3,7 @@ #include "rsys.h" -#ifdef __cplusplus -extern "C" { -#endif +BEGIN_DECLS struct mutex; RSYS_API struct mutex* mutex_create(void); /* NULL <=> error */ @@ -26,9 +24,7 @@ RSYS_API void mutex_rw_rlock(struct mutex_rw* mutex); RSYS_API void mutex_rw_wlock(struct mutex_rw* mutex); RSYS_API void mutex_rw_unlock(struct mutex_rw* mutex); -#ifdef __cplusplus -} /* extern "C" */ -#endif +END_DECLS #endif /* MUTEX_H */ diff --git a/src/str.h b/src/str.h @@ -60,9 +60,7 @@ str_cget(const struct str* str) return str->cstr; } -#ifdef __cplusplus -extern "C" { -#endif +BEGIN_DECLS RSYS_API int /* return 0 on success != 0 otherwise */ str_set @@ -96,9 +94,7 @@ str_reserve (struct str* str, const size_t capacity); -#ifdef __cplusplus -} /* extern "C" */ -#endif +END_DECLS static INLINE int /* return 0 on success != 0 otherwise */ str_copy(struct str* dst, const struct str* src)