]> CyberLeo.Net >> Repos - FreeBSD/releng/10.0.git/blob - contrib/subversion/subversion/libsvn_subr/sqlite3wrapper.c
- Copy stable/10 (r259064) to releng/10.0 as part of the
[FreeBSD/releng/10.0.git] / contrib / subversion / subversion / libsvn_subr / sqlite3wrapper.c
1 /* sqlite3wrapper.c
2  *
3  * ====================================================================
4  *    Licensed to the Apache Software Foundation (ASF) under one
5  *    or more contributor license agreements.  See the NOTICE file
6  *    distributed with this work for additional information
7  *    regarding copyright ownership.  The ASF licenses this file
8  *    to you under the Apache License, Version 2.0 (the
9  *    "License"); you may not use this file except in compliance
10  *    with the License.  You may obtain a copy of the License at
11  *
12  *      http://www.apache.org/licenses/LICENSE-2.0
13  *
14  *    Unless required by applicable law or agreed to in writing,
15  *    software distributed under the License is distributed on an
16  *    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17  *    KIND, either express or implied.  See the License for the
18  *    specific language governing permissions and limitations
19  *    under the License.
20  * ====================================================================
21  */
22
23 #include "svn_private_config.h"
24
25 /* Include sqlite3 inline, making all symbols private. */
26 #ifdef SVN_SQLITE_INLINE
27 #  define SQLITE_OMIT_DEPRECATED
28 #  define SQLITE_API static
29 #  if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ >= 6 || __APPLE_CC__))
30 #    if !__APPLE_CC__ || __GNUC_MINOR__ >= 6
31 #      pragma GCC diagnostic push
32 #    endif
33 #    pragma GCC diagnostic ignored "-Wunreachable-code"
34 #    pragma GCC diagnostic ignored "-Wunused-function"
35 #    pragma GCC diagnostic ignored "-Wcast-qual"
36 #    pragma GCC diagnostic ignored "-Wunused"
37 #    pragma GCC diagnostic ignored "-Wshadow"
38 #    if __APPLE_CC__
39 #      pragma GCC diagnostic ignored "-Wshorten-64-to-32"
40 #    endif
41 #  endif
42 #  ifdef __APPLE__
43 #    include <Availability.h>
44 #    if __MAC_OS_X_VERSION_MIN_REQUIRED < 1060
45        /* <libkern/OSAtomic.h> is included on OS X by sqlite3.c, and
46           on old systems (Leopard or older), it cannot be compiled
47           with -std=c89 because it uses inline. This is a work-around. */
48 #      define inline __inline__
49 #      include <libkern/OSAtomic.h>
50 #      undef inline
51 #    endif
52 #  endif
53 #  include <sqlite3.c>
54 #  if __GNUC__ > 4 || (__GNUC__ == 4 && (__GNUC_MINOR__ >= 6))
55 #    pragma GCC diagnostic pop
56 #  endif
57
58 /* Expose the sqlite API vtable and the two missing functions */
59 const sqlite3_api_routines *const svn_sqlite3__api_funcs = &sqlite3Apis;
60 int (*const svn_sqlite3__api_initialize)(void) = sqlite3_initialize;
61 int (*const svn_sqlite3__api_config)(int, ...)  = sqlite3_config;
62 #endif