httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r349752 - in /httpd/httpd/trunk/modules/database: mod_dbd.c mod_dbd.h
Date Tue, 29 Nov 2005 16:37:53 GMT
Author: colm
Date: Tue Nov 29 08:37:49 2005
New Revision: 349752

URL: http://svn.apache.org/viewcvs?rev=349752&view=rev
Log:
Give DBD a set of _DECLARE macros consistent with other modules, so that
_EXPORT and _STATIC and be turned on/off more easily.

Modified:
    httpd/httpd/trunk/modules/database/mod_dbd.c
    httpd/httpd/trunk/modules/database/mod_dbd.h

Modified: httpd/httpd/trunk/modules/database/mod_dbd.c
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/database/mod_dbd.c?rev=349752&r1=349751&r2=349752&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/database/mod_dbd.c (original)
+++ httpd/httpd/trunk/modules/database/mod_dbd.c Tue Nov 29 08:37:49 2005
@@ -139,7 +139,7 @@
     }
     return NULL;
 }
-AP_DECLARE(void) ap_dbd_prepare(server_rec *s, const char *query,
+DBD_DECLARE(void) ap_dbd_prepare(server_rec *s, const char *query,
                                 const char *label)
 {
     svr_cfg *svr = ap_get_module_config(s->module_config, &dbd_module);
@@ -405,7 +405,7 @@
         - open acquires a connection from the pool (opens one if necessary)
         - close releases it back in to the pool
 */
-AP_DECLARE(void) ap_dbd_close(server_rec *s, ap_dbd_t *sql)
+DBD_DECLARE(void) ap_dbd_close(server_rec *s, ap_dbd_t *sql)
 {
     svr_cfg *svr = ap_get_module_config(s->module_config, &dbd_module);
     if (!svr->persist) {
@@ -419,7 +419,7 @@
 }
 #define arec ((ap_dbd_t*)rec)
 #if APR_HAS_THREADS
-AP_DECLARE(ap_dbd_t*) ap_dbd_open(apr_pool_t *pool, server_rec *s)
+DBD_DECLARE(ap_dbd_t*) ap_dbd_open(apr_pool_t *pool, server_rec *s)
 {
     void *rec = NULL;
     svr_cfg *svr = ap_get_module_config(s->module_config, &dbd_module);
@@ -457,7 +457,7 @@
     return arec;
 }
 #else
-AP_DECLARE(ap_dbd_t*) ap_dbd_open(apr_pool_t *pool, server_rec *s)
+DBD_DECLARE(ap_dbd_t*) ap_dbd_open(apr_pool_t *pool, server_rec *s)
 {
     apr_status_t rv = APR_SUCCESS;
     const char *errmsg;
@@ -506,7 +506,7 @@
     apr_reslist_release(req->dbpool, req->conn);
     return APR_SUCCESS;
 }
-AP_DECLARE(ap_dbd_t *) ap_dbd_acquire(request_rec *r)
+DBD_DECLARE(ap_dbd_t *) ap_dbd_acquire(request_rec *r)
 {
     svr_cfg *svr;
     dbd_pool_rec *req = ap_get_module_config(r->request_config, &dbd_module);
@@ -529,7 +529,7 @@
     }
     return req->conn;
 }
-AP_DECLARE(ap_dbd_t *) ap_dbd_cacquire(conn_rec *c)
+DBD_DECLARE(ap_dbd_t *) ap_dbd_cacquire(conn_rec *c)
 {
     svr_cfg *svr;
     dbd_pool_rec *req = ap_get_module_config(c->conn_config, &dbd_module);
@@ -553,7 +553,7 @@
     return req->conn;
 }
 #else
-AP_DECLARE(ap_dbd_t *) ap_dbd_acquire(request_rec *r)
+DBD_DECLARE(ap_dbd_t *) ap_dbd_acquire(request_rec *r)
 {
     svr_cfg *svr;
     ap_dbd_t *ret = ap_get_module_config(r->request_config, &dbd_module);
@@ -571,7 +571,7 @@
     }
     return ret;
 }
-AP_DECLARE(ap_dbd_t *) ap_dbd_cacquire(conn_rec *c)
+DBD_DECLARE(ap_dbd_t *) ap_dbd_cacquire(conn_rec *c)
 {
     svr_cfg *svr;
     ap_dbd_t *ret = ap_get_module_config(c->conn_config, &dbd_module);

Modified: httpd/httpd/trunk/modules/database/mod_dbd.h
URL: http://svn.apache.org/viewcvs/httpd/httpd/trunk/modules/database/mod_dbd.h?rev=349752&r1=349751&r2=349752&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/database/mod_dbd.h (original)
+++ httpd/httpd/trunk/modules/database/mod_dbd.h Tue Nov 29 08:37:49 2005
@@ -32,6 +32,27 @@
 #ifndef DBD_H
 #define DBD_H
 
+/* Create a set of DBD_DECLARE(type), DBD_DECLARE_NONSTD(type) and 
+ * DBD_DECLARE_DATA with appropriate export and import tags for the platform
+ */
+#if !defined(WIN32)
+#define DBD_DECLARE(type)            type
+#define DBD_DECLARE_NONSTD(type)     type
+#define DBD_DECLARE_DATA
+#elif defined(DBD_DECLARE_STATIC)
+#define DBD_DECLARE(type)            type __stdcall
+#define DBD_DECLARE_NONSTD(type)     type
+#define DBD_DECLARE_DATA
+#elif defined(DBD_DECLARE_EXPORT)
+#define DBD_DECLARE(type)            __declspec(dllexport) type __stdcall
+#define DBD_DECLARE_NONSTD(type)     __declspec(dllexport) type
+#define DBD_DECLARE_DATA             __declspec(dllexport)
+#else
+#define DBD_DECLARE(type)            __declspec(dllimport) type __stdcall
+#define DBD_DECLARE_NONSTD(type)     __declspec(dllimport) type
+#define DBD_DECLARE_DATA             __declspec(dllimport)
+#endif
+
 #include <httpd.h>
 #include <apr_optional.h>
 #include <apr_hash.h>
@@ -48,28 +69,28 @@
 /* acquire a connection that MUST be explicitly closed.
  * Returns NULL on error
  */
-AP_DECLARE(ap_dbd_t*) ap_dbd_open(apr_pool_t*, server_rec*);
+DBD_DECLARE(ap_dbd_t*) ap_dbd_open(apr_pool_t*, server_rec*);
 
 /* release a connection acquired with ap_dbd_open */
-AP_DECLARE(void) ap_dbd_close(server_rec*, ap_dbd_t*);
+DBD_DECLARE(void) ap_dbd_close(server_rec*, ap_dbd_t*);
 
 /* acquire a connection that will have the lifetime of a request
  * and MUST NOT be explicitly closed.  Return NULL on error.
  * This is the preferred function for most applications.
  */
-AP_DECLARE(ap_dbd_t*) ap_dbd_acquire(request_rec*);
+DBD_DECLARE(ap_dbd_t*) ap_dbd_acquire(request_rec*);
 
 /* acquire a connection that will have the lifetime of a connection
  * and MUST NOT be explicitly closed.  Return NULL on error.
  * This is the preferred function for most applications.
  */
-AP_DECLARE(ap_dbd_t*) ap_dbd_cacquire(conn_rec*);
+DBD_DECLARE(ap_dbd_t*) ap_dbd_cacquire(conn_rec*);
 
 /* Prepare a statement for use by a client module during
  * the server startup/configuration phase.  Can't be called
  * after the server has created its children (use apr_dbd_*).
  */
-AP_DECLARE(void) ap_dbd_prepare(server_rec*, const char*, const char*);
+DBD_DECLARE(void) ap_dbd_prepare(server_rec*, const char*, const char*);
 
 /* Also export them as optional functions for modules that prefer it */
 APR_DECLARE_OPTIONAL_FN(ap_dbd_t*, ap_dbd_open, (apr_pool_t*, server_rec*));



Mime
View raw message