diff options
author | William A. Rowe Jr <wrowe@apache.org> | 2009-12-21 21:25:45 +0000 |
---|---|---|
committer | William A. Rowe Jr <wrowe@apache.org> | 2009-12-21 21:25:45 +0000 |
commit | 01cbd85e1c0a3d4fca012e601211f7f2139a9c8c (patch) | |
tree | c8f2f04071a2b06f2f4493dae9860e48410af5e6 | |
parent | adab42e39c1c2a3ce5bf9a92e76ab59e42a959f1 (diff) | |
download | apr-01cbd85e1c0a3d4fca012e601211f7f2139a9c8c.tar.gz |
Refactor away apu_version legacy cruft
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@892984 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | crypto/apr_crypto.c | 8 | ||||
-rw-r--r-- | dbd/apr_dbd.c | 5 | ||||
-rw-r--r-- | dbd/apr_dbd_mysql.c | 1 | ||||
-rw-r--r-- | dbd/apr_dbd_odbc.c | 16 | ||||
-rw-r--r-- | dbm/apr_dbm.c | 6 | ||||
-rw-r--r-- | include/apu_version.h | 79 |
6 files changed, 35 insertions, 80 deletions
diff --git a/crypto/apr_crypto.c b/crypto/apr_crypto.c index 31a8cf0b8..dcb0c92d4 100644 --- a/crypto/apr_crypto.c +++ b/crypto/apr_crypto.c @@ -1,7 +1,7 @@ /* Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache License, Version 2.0 + * The ASF licenses this file to You under the Apache License, 3 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * @@ -31,7 +31,7 @@ #include "apu_internal.h" #include "apr_crypto_internal.h" #include "apr_crypto.h" -#include "apu_version.h" +#include "apr_version.h" static apr_hash_t *drivers = NULL; @@ -135,9 +135,9 @@ APR_DECLARE(apr_status_t) apr_crypto_get_driver(apr_pool_t *pool, const char *na apr_snprintf(modname, sizeof(modname), "crypto%s.nlm", name); #elif defined(WIN32) apr_snprintf(modname, sizeof(modname), - "apr_crypto_%s-" APU_STRINGIFY(APU_MAJOR_VERSION) ".dll", name); + "apr_crypto_%s-" APR_STRINGIFY(APR_MAJOR_VERSION) ".dll", name); #else - apr_snprintf(modname, sizeof(modname), "apr_crypto_%s-" APU_STRINGIFY(APU_MAJOR_VERSION) ".so", name); + apr_snprintf(modname, sizeof(modname), "apr_crypto_%s-" APR_STRINGIFY(APR_MAJOR_VERSION) ".so", name); #endif apr_snprintf(symname, sizeof(symname), "apr_crypto_%s_driver", name); rv = apu_dso_load(&dso, &symbol, modname, symname, pool); diff --git a/dbd/apr_dbd.c b/dbd/apr_dbd.c index 656870320..9d2738100 100644 --- a/dbd/apr_dbd.c +++ b/dbd/apr_dbd.c @@ -30,7 +30,6 @@ #include "apu_internal.h" #include "apr_dbd_internal.h" #include "apr_dbd.h" -#include "apu_version.h" static apr_hash_t *drivers = NULL; static apr_uint32_t initialised = 0, in_init = 1; @@ -185,10 +184,10 @@ APR_DECLARE(apr_status_t) apr_dbd_get_driver(apr_pool_t *pool, const char *name, apr_snprintf(modname, sizeof(modname), "dbd%s.nlm", name); #elif defined(WIN32) apr_snprintf(modname, sizeof(modname), - "apr_dbd_%s-" APU_STRINGIFY(APU_MAJOR_VERSION) ".dll", name); + "apr_dbd_%s-" APR_STRINGIFY(APR_MAJOR_VERSION) ".dll", name); #else apr_snprintf(modname, sizeof(modname), - "apr_dbd_%s-" APU_STRINGIFY(APU_MAJOR_VERSION) ".so", name); + "apr_dbd_%s-" APR_STRINGIFY(APR_MAJOR_VERSION) ".so", name); #endif apr_snprintf(symname, sizeof(symname), "apr_dbd_%s_driver", name); rv = apu_dso_load(NULL, &symbol, modname, symname, pool); diff --git a/dbd/apr_dbd_mysql.c b/dbd/apr_dbd_mysql.c index fdd14f6f2..7cad22d6f 100644 --- a/dbd/apr_dbd_mysql.c +++ b/dbd/apr_dbd_mysql.c @@ -18,7 +18,6 @@ #if APU_HAVE_MYSQL -#include "apu_version.h" #include "apr_private.h" #include <ctype.h> diff --git a/dbd/apr_dbd_odbc.c b/dbd/apr_dbd_odbc.c index 552ecbf93..66e8bff13 100644 --- a/dbd/apr_dbd_odbc.c +++ b/dbd/apr_dbd_odbc.c @@ -26,7 +26,7 @@ #include "apr_file_info.h" #include "apr_dbd_internal.h" #include "apr_thread_proc.h" -#include "apu_version.h" +#include "apr_version.h" #include <stdlib.h> @@ -949,18 +949,18 @@ static void odbc_init(apr_pool_t *pool) { SQLRETURN rc; char *step; - apr_version_t apuver; + apr_version_t aprver; - apu_version(&apuver); - if (apuver.major != DRIVER_APU_VERSION_MAJOR - || apuver.minor != DRIVER_APU_VERSION_MINOR) { + apr_version(&aprver); + if (aprver.major != DRIVER_APR_VERSION_MAJOR + || aprver.minor != DRIVER_APR_VERSION_MINOR) { apr_file_t *se; apr_file_open_stderr(&se, pool); apr_file_printf(se, "Incorrect " ODBC_DRIVER_STRING " dbd driver version\n" - "Attempt to load APU version %d.%d driver with APU version %d.%d\n", - DRIVER_APU_VERSION_MAJOR, DRIVER_APU_VERSION_MINOR, - apuver.major, apuver.minor); + "Attempt to load APR version %d.%d driver with APR version %d.%d\n", + DRIVER_APR_VERSION_MAJOR, DRIVER_APR_VERSION_MINOR, + aprver.major, aprver.minor); abort(); } diff --git a/dbm/apr_dbm.c b/dbm/apr_dbm.c index 2e24106cb..60ec6c5c5 100644 --- a/dbm/apr_dbm.c +++ b/dbm/apr_dbm.c @@ -29,7 +29,7 @@ #include "apu.h" #include "apr_private.h" #include "apu_internal.h" -#include "apu_version.h" +#include "apr_version.h" #include "apr_dbm_private.h" #include "apu_select_dbm.h" #include "apr_dbm.h" @@ -164,10 +164,10 @@ static apr_status_t dbm_open_type(apr_dbm_type_t const* * vtable, apr_snprintf(modname, sizeof(modname), "dbm%s.nlm", type); #elif defined(WIN32) apr_snprintf(modname, sizeof(modname), - "apr_dbm_%s-" APU_STRINGIFY(APU_MAJOR_VERSION) ".dll", type); + "apr_dbm_%s-" APR_STRINGIFY(APR_MAJOR_VERSION) ".dll", type); #else apr_snprintf(modname, sizeof(modname), - "apr_dbm_%s-" APU_STRINGIFY(APU_MAJOR_VERSION) ".so", type); + "apr_dbm_%s-" APR_STRINGIFY(APR_MAJOR_VERSION) ".so", type); #endif apr_snprintf(symname, sizeof(symname), "apr_dbm_type_%s", type); diff --git a/include/apu_version.h b/include/apu_version.h index 66f3e818d..305422575 100644 --- a/include/apu_version.h +++ b/include/apu_version.h @@ -38,36 +38,48 @@ */ +#include "apr_version.h" + /* The numeric compile-time version constants. These constants are the - * authoritative version numbers for APU. + * authoritative version numbers for APU. This file remains as strictly + * a compatibility stub. */ /** major version * Major API changes that could cause compatibility problems for older * programs such as structure size changes. No binary compatibility is * possible across a change in the major version. + * In 2.0, for legacy support, this is an identity of the APR version. + * @deprecated @see APR_MAJOR_VERSION */ -#define APU_MAJOR_VERSION 2 +#define APU_MAJOR_VERSION APR_MAJOR_VERSION /** minor version * Minor API changes that do not cause binary compatibility problems. * Reset to 0 when upgrading APU_MAJOR_VERSION + * In 2.0, for legacy support, this is an identity of the APR version. + * @deprecated @see APR_MINOR_VERSION */ -#define APU_MINOR_VERSION 0 +#define APU_MINOR_VERSION APR_MINOR_VERSION /** patch level * The Patch Level never includes API changes, simply bug fixes. * Reset to 0 when upgrading APR_MINOR_VERSION + * In 2.0, for legacy support, this is an identity of the APR version. + * @deprecated @see APR_PATCH_VERSION */ -#define APU_PATCH_VERSION 0 +#define APU_PATCH_VERSION APR_PATCH_VERSION /** * The symbol APU_IS_DEV_VERSION is only defined for internal, * "development" copies of APU. It is undefined for released versions * of APU. + * In 2.0, for legacy support, this is an identity of the APR version. + * @deprecated @see APR_IS_DEV_VERSION */ -#define APU_IS_DEV_VERSION - +#ifdef APR_IS_DEV_VERSION +# define APU_IS_DEV_VERSION +#endif #if defined(APU_IS_DEV_VERSION) || defined(DOXYGEN) /** Internal: string form of the "is dev" flag */ @@ -76,59 +88,4 @@ #define APU_IS_DEV_STRING "" #endif - -#ifndef APU_STRINGIFY -/** Properly quote a value as a string in the C preprocessor */ -#define APU_STRINGIFY(n) APU_STRINGIFY_HELPER(n) -/** Helper macro for APU_STRINGIFY */ -#define APU_STRINGIFY_HELPER(n) #n -#endif - -/** The formatted string of APU's version */ -#define APU_VERSION_STRING \ - APU_STRINGIFY(APU_MAJOR_VERSION) "." \ - APU_STRINGIFY(APU_MINOR_VERSION) "." \ - APU_STRINGIFY(APU_PATCH_VERSION) \ - APU_IS_DEV_STRING - -/** An alternative formatted string of APR's version */ -/* macro for Win32 .rc files using numeric csv representation */ -#define APU_VERSION_STRING_CSV APU_MAJOR_VERSION ##, \ - ##APU_MINOR_VERSION ##, \ - ##APU_PATCH_VERSION - - -#ifndef APU_VERSION_ONLY - -/* The C language API to access the version at run time, - * as opposed to compile time. APU_VERSION_ONLY may be defined - * externally when preprocessing apr_version.h to obtain strictly - * the C Preprocessor macro declarations. - */ - -#include "apr_version.h" - -#include "apu.h" - -#ifdef __cplusplus -extern "C" { -#endif - -/** - * Return APR-util's version information information in a numeric form. - * - * @param pvsn Pointer to a version structure for returning the version - * information. - */ -APR_DECLARE(void) apu_version(apr_version_t *pvsn); - -/** Return APU's version information as a string. */ -APR_DECLARE(const char *) apu_version_string(void); - -#ifdef __cplusplus -} -#endif - -#endif /* ndef APU_VERSION_ONLY */ - #endif /* ndef APU_VERSION_H */ |