GDAL

ogr_libs.h
1 /******************************************************************************
2 * $Id$
3 *
4 * Project: OpenGIS Simple Features Reference Implementation
5 * Purpose: Definitions related to support for use of SFCGAL and GEOS in OGR.
6 * This file is only intended to be pulled in by OGR implementation
7 * code directly accessing SFCGAL and/or GEOS.
8 * Author: Avyav Kumar Singh <avyavkumar at gmail dot com>
9 *
10 ******************************************************************************
11 * Copyright (c) 2016, Avyav Kumar Singh <avyavkumar at gmail dot com>
12 *
13 * Permission is hereby granted, free of charge, to any person obtaining a
14 * copy of this software and associated documentation files (the "Software"),
15 * to deal in the Software without restriction, including without limitation
16 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
17 * and/or sell copies of the Software, and to permit persons to whom the
18 * Software is furnished to do so, subject to the following conditions:
19 *
20 * The above copyright notice and this permission notice shall be included
21 * in all copies or substantial portions of the Software.
22 *
23 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
24 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
25 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
26 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
27 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
28 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
29 * DEALINGS IN THE SOFTWARE.
30 ****************************************************************************/
31
32 #ifndef HAVE_GEOS
33 #define UNUSED_IF_NO_GEOS CPL_UNUSED
34 #else
35 #define UNUSED_IF_NO_GEOS
36 #endif
37
38 #ifndef HAVE_SFCGAL
39 #define UNUSED_IF_NO_SFCGAL CPL_UNUSED
40 #else
41 #define UNUSED_IF_NO_SFCGAL
42 #endif
43
44 #ifndef UNUSED_PARAMETER
45
46 #ifdef HAVE_GEOS
47 #ifndef HAVE_SFCGAL
48 #define UNUSED_PARAMETER \
49 UNUSED_IF_NO_SFCGAL // SFCGAL no and GEOS yes - GEOS methods always work
50 #else
51 #define UNUSED_PARAMETER // Both libraries are present
52 #endif
53 #endif
54
55 #ifndef HAVE_GEOS
56 #ifdef HAVE_SFCGAL
57 #define UNUSED_PARAMETER \
58 UNUSED_IF_NO_GEOS // SFCGAL yes and GEOS no - SFCGAL methods always work
59 #else
60 #define UNUSED_PARAMETER \
61 CPL_UNUSED // Neither of the libraries have support enabled
62 #endif
63 #endif
64
65 #endif