diff options
author | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-08-05 16:22:51 +0000 |
---|---|---|
committer | Lorry Tar Creator <lorry-tar-importer@lorry> | 2017-08-05 16:22:51 +0000 |
commit | cf46733632c7279a9fd0fe6ce26f9185a4ae82a9 (patch) | |
tree | da27775a2161723ef342e91af41a8b51fedef405 /subversion/include/svn_types.h | |
parent | bb0ef45f7c46b0ae221b26265ef98a768c33f820 (diff) | |
download | subversion-tarball-master.tar.gz |
subversion-1.9.7HEADsubversion-1.9.7master
Diffstat (limited to 'subversion/include/svn_types.h')
-rw-r--r-- | subversion/include/svn_types.h | 79 |
1 files changed, 74 insertions, 5 deletions
diff --git a/subversion/include/svn_types.h b/subversion/include/svn_types.h index 1ad2194..f1a0850 100644 --- a/subversion/include/svn_types.h +++ b/subversion/include/svn_types.h @@ -32,6 +32,7 @@ #include <limits.h> /* for ULONG_MAX */ #include <apr.h> /* for apr_size_t, apr_int64_t, ... */ +#include <apr_version.h> #include <apr_errno.h> /* for apr_status_t */ #include <apr_pools.h> /* for apr_pool_t */ #include <apr_hash.h> /* for apr_hash_t */ @@ -64,6 +65,50 @@ extern "C" { #endif +/** Macro used to mark experimental functions. + * + * @since New in 1.9. + */ +#ifndef SVN_EXPERIMENTAL +# if !defined(SWIGPERL) && !defined(SWIGPYTHON) && !defined(SWIGRUBY) +# if defined(__has_attribute) +# if __has_attribute(__warning__) +# define SVN_EXPERIMENTAL __attribute__((warning("experimental function used"))) +# else +# define SVN_EXPERIMENTAL +# endif +# elif !defined(__llvm__) && defined(__GNUC__) \ + && (__GNUC__ >= 4 || (__GNUC__==3 && __GNUC_MINOR__>=1)) +# define SVN_EXPERIMENTAL __attribute__((warning("experimental function used"))) +# elif defined(_MSC_VER) && _MSC_VER >= 1300 +# define SVN_EXPERIMENTAL __declspec(deprecated("experimental function used")) +# else +# define SVN_EXPERIMENTAL +# endif +# else +# define SVN_EXPERIMENTAL +# endif +#endif + +/** Macro used to mark functions that require a final null sentinel argument. + * + * @since New in 1.9. + */ +#ifndef SVN_NEEDS_SENTINEL_NULL +# if defined(__has_attribute) +# if __has_attribute(__sentinel__) +# define SVN_NEEDS_SENTINEL_NULL __attribute__((sentinel)) +# else +# define SVN_NEEDS_SENTINEL_NULL +# endif +# elif defined(__GNUC__) && (__GNUC__ >= 4) +# define SVN_NEEDS_SENTINEL_NULL __attribute__((sentinel)) +# else +# define SVN_NEEDS_SENTINEL_NULL +# endif +#endif + + /** Indicate whether the current platform supports unaligned data access. * * On the majority of machines running SVN (x86 / x64), unaligned access @@ -105,6 +150,26 @@ typedef int svn_boolean_t; +/* Declaration of a unique type, never defined, for the SVN_VA_NULL macro. + * + * NOTE: Private. Not for direct use by third-party code. + */ +struct svn__null_pointer_constant_stdarg_sentinel_t; + +/** Null pointer constant used as a sentinel in variable argument lists. + * + * Use of this macro ensures that the argument is of the correct size when a + * pointer is expected. (The macro @c NULL is not defined as a pointer on + * all systems, and the arguments to variadic functions are not converted + * automatically to the expected type.) + * + * @since New in 1.9. + */ +#define SVN_VA_NULL ((struct svn__null_pointer_constant_stdarg_sentinel_t*)0) +/* See? (char*)NULL -- They have the same length, but the cast looks ugly. */ + + + /** Subversion error object. * * Defined here, rather than in svn_error.h, to avoid a recursive @#include @@ -186,21 +251,26 @@ typedef struct svn_version_t svn_version_t; * These functions enable the caller to dereference an APR hash table index * without type casts or temporary variables. * - * ### These are private, and may go away when APR implements them natively. + * These functions are provided by APR itself from version 1.5. + * Definitions are provided here for when using older versions of APR. * @{ */ +#if !APR_VERSION_AT_LEAST(1, 5, 0) + /** Return the key of the hash table entry indexed by @a hi. */ const void * -svn__apr_hash_index_key(const apr_hash_index_t *hi); +apr_hash_this_key(apr_hash_index_t *hi); /** Return the key length of the hash table entry indexed by @a hi. */ apr_ssize_t -svn__apr_hash_index_klen(const apr_hash_index_t *hi); +apr_hash_this_key_len(apr_hash_index_t *hi); /** Return the value of the hash table entry indexed by @a hi. */ void * -svn__apr_hash_index_val(const apr_hash_index_t *hi); +apr_hash_this_val(apr_hash_index_t *hi); + +#endif /** @} */ @@ -1001,7 +1071,6 @@ typedef svn_error_t *(*svn_log_message_receiver_t)( const char *message, apr_pool_t *pool); - /** Callback function type for commits. * |