apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Guenter Knauf <fua...@apache.org>
Subject Re: svn commit: r551983 - in /apr/apr-util/branches/1.2.x: dbd/apr_dbd.c
Date Tue, 03 Jul 2007 14:57:51 GMT
Hi,
if nobody objects I will soon commit the following patch to both 1.3.x / 1.2.x trunk;
this moves the dbd driver name to platform-own apu.h header files, and removes the ifdefs
in apr_dbd.c:
############################################################################# 
--- dbd\apr_dbd.c.orig	Wed Jun 27 14:53:02 2007
+++ dbd\apr_dbd.c	Tue Jul 03 16:14:40 2007
@@ -150,19 +150,12 @@
     /* The driver DSO must have exactly the same lifetime as the
      * drivers hash table; ignore the passed-in pool */
     pool = apr_hash_pool_get(drivers);
-
-#ifdef WIN32
-    sprintf(path, "apr_dbd_%s.dll", name);
-#elif defined(NETWARE)
-    apr_snprintf(path, sizeof path, "dbd%s.nlm", name);
-#else
-    apr_snprintf(path, sizeof path, APU_DSO_LIBDIR "/apr_dbd_%s.so", name);
-#endif
+    apr_snprintf(path, sizeof path, APU_DBD_DRIVER_FMT, name);
     rv = apr_dso_load(&dlhandle, path, pool);
     if (rv != APR_SUCCESS) { /* APR_EDSOOPEN */
         goto unlock;
     }
-    sprintf(path, "apr_dbd_%s_driver", name);
+    apr_snprintf(path, sizeof path, "apr_dbd_%s_driver", name);
     rv = apr_dso_sym(&symbol, dlhandle, path);
     if (rv != APR_SUCCESS) { /* APR_ESYMNOTFOUND */
         apr_dso_unload(dlhandle);
############################################################################# 
--- include\apu.h.in.orig	Wed Jun 27 14:53:00 2007
+++ include\apu.h.in	Tue Jul 03 16:13:06 2007
@@ -88,5 +88,7 @@
 #define APU_HAVE_ICONV         @have_iconv@
 #define APR_HAS_XLATE          (APU_HAVE_APR_ICONV || APU_HAVE_ICONV)
 
+#define APU_DBD_DRIVER_FMT APU_DSO_LIBDIR "/apr_dbd_%s.so"
+
 #endif /* APU_H */
 /** @} */
############################################################################# 
--- include\apu.hnw.orig	Wed Jun 27 14:53:00 2007
+++ include\apu.hnw	Tue Jul 03 16:12:34 2007
@@ -82,5 +82,7 @@
 #define APU_HAVE_ICONV         1
 #define APR_HAS_XLATE          (APU_HAVE_APR_ICONV || APU_HAVE_ICONV)
 
+#define APU_DBD_DRIVER_FMT "dbd%s.nlm"
+
 #endif /* APU_H */
 /** @} */
############################################################################# 
--- include\apu.hw.orig	Wed Jun 27 14:53:00 2007
+++ include\apu.hw	Tue Jul 03 16:11:18 2007
@@ -109,5 +109,7 @@
 #define APU_HAVE_SQLITE3    0
 #endif
 
+#define APU_DBD_DRIVER_FMT "apr_dbd_%s.dll"
+
 #endif /* APU_H */
 #endif /* WIN32 */
############################################################################# 

Guenter.



Mime
View raw message