You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2012/11/09 22:16:59 UTC

svn commit: r1407642 - in /subversion/branches/wc-collate-path/subversion/libsvn_subr: sqlite.c sqlite3wrapper.c

Author: brane
Date: Fri Nov  9 21:16:58 2012
New Revision: 1407642

URL: http://svn.apache.org/viewvc?rev=1407642&view=rev
Log:
On the wc-collate-path branch: Move the amalgamated SQLite import to
a separate file to avoid having to wade through tons of warnings from
sqlite3.c every time I change some header that sqlite.c uses.

* subversion/libsvn_subr/sqlite3wrapper.c: New file. When SVN_SQLITE_INLINE
   is defined, include the amalgamated sqlite3.c here. Also define
   SQLITE_OMIT_DEPRECATED to not include deprecated APIs in the vtable.
  (sqlite3_api): Exported API vtable normallt used by SQLite extensions.

* subversion/libsvn_subr/sqlite.c:  When SVN_SQLITE_INLINE is defined,
  define SQLITE_OMIT_DEPRECATED and include sqlite3ext.h to get the
  vtable devfinition, then ...
  (extern sqlite3_api): ... import the actual vtable from sqlite3wrapper.

Added:
    subversion/branches/wc-collate-path/subversion/libsvn_subr/sqlite3wrapper.c
Modified:
    subversion/branches/wc-collate-path/subversion/libsvn_subr/sqlite.c

Modified: subversion/branches/wc-collate-path/subversion/libsvn_subr/sqlite.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_subr/sqlite.c?rev=1407642&r1=1407641&r2=1407642&view=diff
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_subr/sqlite.c (original)
+++ subversion/branches/wc-collate-path/subversion/libsvn_subr/sqlite.c Fri Nov  9 21:16:58 2012
@@ -45,27 +45,12 @@
 #endif
 
 #ifdef SVN_SQLITE_INLINE
-/* Include sqlite3 inline, making all symbols private. */
-  #define SQLITE_API static
-  #if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ >= 6 || __APPLE_CC__))
-    #if !__APPLE_CC__ || __GNUC_MINOR__ >= 6
-      #pragma GCC diagnostic push
-    #endif
-    #pragma GCC diagnostic ignored "-Wunreachable-code"
-    #pragma GCC diagnostic ignored "-Wunused-function"
-    #pragma GCC diagnostic ignored "-Wcast-qual"
-    #pragma GCC diagnostic ignored "-Wunused"
-    #pragma GCC diagnostic ignored "-Wshadow"
-    #if __APPLE_CC__
-      #pragma GCC diagnostic ignored "-Wshorten-64-to-32"
-    #endif
-  #endif
-  #include <sqlite3.c>
-  #if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ >= 6))
-    #pragma GCC diagnostic pop
-  #endif
+/* Import the sqlite3 API vtable from sqlite3wrapper.c */
+#define SQLITE_OMIT_DEPRECATED
+#include <sqlite3ext.h>
+extern const sqlite3_api_routines *const sqlite3_api;
 #else
-  #include <sqlite3.h>
+#include <sqlite3.h>
 #endif
 
 #if !SQLITE_VERSION_AT_LEAST(3,7,12)

Added: subversion/branches/wc-collate-path/subversion/libsvn_subr/sqlite3wrapper.c
URL: http://svn.apache.org/viewvc/subversion/branches/wc-collate-path/subversion/libsvn_subr/sqlite3wrapper.c?rev=1407642&view=auto
==============================================================================
--- subversion/branches/wc-collate-path/subversion/libsvn_subr/sqlite3wrapper.c (added)
+++ subversion/branches/wc-collate-path/subversion/libsvn_subr/sqlite3wrapper.c Fri Nov  9 21:16:58 2012
@@ -0,0 +1,49 @@
+/* sqlite3wrapper.c
+ *
+ * ====================================================================
+ *    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
+ *    "License"); you may not use this file except in compliance
+ *    with the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ *    Unless required by applicable law or agreed to in writing,
+ *    software distributed under the License is distributed on an
+ *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ *    KIND, either express or implied.  See the License for the
+ *    specific language governing permissions and limitations
+ *    under the License.
+ * ====================================================================
+ */
+
+#include "svn_private_config.h"
+
+/* Include sqlite3 inline, making all symbols private. */
+#ifdef SVN_SQLITE_INLINE
+#  define SQLITE_OMIT_DEPRECATED
+#  define SQLITE_API static
+#  if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ >= 6 || __APPLE_CC__))
+#    if !__APPLE_CC__ || __GNUC_MINOR__ >= 6
+#      pragma GCC diagnostic push
+#    endif
+#    pragma GCC diagnostic ignored "-Wunreachable-code"
+#    pragma GCC diagnostic ignored "-Wunused-function"
+#    pragma GCC diagnostic ignored "-Wcast-qual"
+#    pragma GCC diagnostic ignored "-Wunused"
+#    pragma GCC diagnostic ignored "-Wshadow"
+#    if __APPLE_CC__
+#      pragma GCC diagnostic ignored "-Wshorten-64-to-32"
+#    endif
+#  endif
+#  include <sqlite3.c>
+#  if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ >= 6))
+#    pragma GCC diagnostic pop
+#  endif
+
+/* Expose the sqlite API vtable */
+const sqlite3_api_routines *const sqlite3_api = &sqlite3Apis;
+#endif