X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fgl_xlist.h;h=a4f4e89c0ad8c1969aab259ce056f3421fc69d01;hb=7ef6c64e210ac0979d7e8ac69bc5b5208c2405ab;hp=4c901be4b71d0f8affba6adeeef3018253e045f5;hpb=2d4d7d9d00fe33b6f5291e00a30b6c1016775b74;p=gnulib.git diff --git a/lib/gl_xlist.h b/lib/gl_xlist.h index 4c901be4b..a4f4e89c0 100644 --- a/lib/gl_xlist.h +++ b/lib/gl_xlist.h @@ -1,5 +1,5 @@ /* Abstract sequential list data type, with out-of-memory checking. - Copyright (C) 2009 Free Software Foundation, Inc. + Copyright (C) 2009-2014 Free Software Foundation, Inc. Written by Bruno Haible , 2009. This program is free software: you can redistribute it and/or modify @@ -21,6 +21,14 @@ #include "gl_list.h" #include "xalloc.h" +#ifndef _GL_INLINE_HEADER_BEGIN + #error "Please include config.h first." +#endif +_GL_INLINE_HEADER_BEGIN +#ifndef GL_XLIST_INLINE +# define GL_XLIST_INLINE _GL_INLINE +#endif + #ifdef __cplusplus extern "C" { #endif @@ -28,6 +36,7 @@ extern "C" { /* These functions are thin wrappers around the corresponding functions with _nx_ infix from gl_list.h. Upon out-of-memory, they invoke xalloc_die (), instead of returning an error indicator. */ +#if 0 /* These are defined inline below. */ extern gl_list_t gl_list_create_empty (gl_list_implementation_t implementation, gl_listelement_equals_fn equals_fn, gl_listelement_hashcode_fn hashcode_fn, @@ -54,11 +63,9 @@ extern gl_list_node_t gl_list_add_at (gl_list_t list, size_t position, extern gl_list_node_t gl_sortedlist_add (gl_list_t list, gl_listelement_compar_fn compar, const void *elt); +#endif -#if HAVE_INLINE - -# define gl_list_create_empty gl_list_create_empty_inline -static inline gl_list_t +GL_XLIST_INLINE gl_list_t gl_list_create_empty (gl_list_implementation_t implementation, gl_listelement_equals_fn equals_fn, gl_listelement_hashcode_fn hashcode_fn, @@ -73,8 +80,7 @@ gl_list_create_empty (gl_list_implementation_t implementation, return result; } -# define gl_list_create gl_list_create_inline -static inline gl_list_t +GL_XLIST_INLINE gl_list_t gl_list_create (gl_list_implementation_t implementation, gl_listelement_equals_fn equals_fn, gl_listelement_hashcode_fn hashcode_fn, @@ -90,8 +96,7 @@ gl_list_create (gl_list_implementation_t implementation, return result; } -# define gl_list_node_set_value gl_list_node_set_value_inline -static inline void +GL_XLIST_INLINE void gl_list_node_set_value (gl_list_t list, gl_list_node_t node, const void *elt) { int result = gl_list_node_nx_set_value (list, node, elt); @@ -99,8 +104,7 @@ gl_list_node_set_value (gl_list_t list, gl_list_node_t node, const void *elt) xalloc_die (); } -# define gl_list_set_at gl_list_set_at_inline -static inline gl_list_node_t +GL_XLIST_INLINE gl_list_node_t gl_list_set_at (gl_list_t list, size_t position, const void *elt) { gl_list_node_t result = gl_list_nx_set_at (list, position, elt); @@ -109,8 +113,7 @@ gl_list_set_at (gl_list_t list, size_t position, const void *elt) return result; } -# define gl_list_add_first gl_list_add_first_inline -static inline gl_list_node_t +GL_XLIST_INLINE gl_list_node_t gl_list_add_first (gl_list_t list, const void *elt) { gl_list_node_t result = gl_list_nx_add_first (list, elt); @@ -119,8 +122,7 @@ gl_list_add_first (gl_list_t list, const void *elt) return result; } -# define gl_list_add_last gl_list_add_last_inline -static inline gl_list_node_t +GL_XLIST_INLINE gl_list_node_t gl_list_add_last (gl_list_t list, const void *elt) { gl_list_node_t result = gl_list_nx_add_last (list, elt); @@ -129,8 +131,7 @@ gl_list_add_last (gl_list_t list, const void *elt) return result; } -# define gl_list_add_before gl_list_add_before_inline -static inline gl_list_node_t +GL_XLIST_INLINE gl_list_node_t gl_list_add_before (gl_list_t list, gl_list_node_t node, const void *elt) { gl_list_node_t result = gl_list_nx_add_before (list, node, elt); @@ -139,8 +140,7 @@ gl_list_add_before (gl_list_t list, gl_list_node_t node, const void *elt) return result; } -# define gl_list_add_after gl_list_add_after_inline -static inline gl_list_node_t +GL_XLIST_INLINE gl_list_node_t gl_list_add_after (gl_list_t list, gl_list_node_t node, const void *elt) { gl_list_node_t result = gl_list_nx_add_after (list, node, elt); @@ -149,8 +149,7 @@ gl_list_add_after (gl_list_t list, gl_list_node_t node, const void *elt) return result; } -# define gl_list_add_at gl_list_add_at_inline -static inline gl_list_node_t +GL_XLIST_INLINE gl_list_node_t gl_list_add_at (gl_list_t list, size_t position, const void *elt) { gl_list_node_t result = gl_list_nx_add_at (list, position, elt); @@ -159,8 +158,7 @@ gl_list_add_at (gl_list_t list, size_t position, const void *elt) return result; } -# define gl_sortedlist_add gl_sortedlist_add_inline -static inline gl_list_node_t +GL_XLIST_INLINE gl_list_node_t gl_sortedlist_add (gl_list_t list, gl_listelement_compar_fn compar, const void *elt) { @@ -170,10 +168,10 @@ gl_sortedlist_add (gl_list_t list, gl_listelement_compar_fn compar, return result; } -#endif - #ifdef __cplusplus } #endif +_GL_INLINE_HEADER_END + #endif /* _GL_XLIST_H */