annotate Framework/PostgreSQL/PostgreSQLIncludes.h @ 312:117cf247c086

added unit test
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 14 Jul 2021 14:31:12 +0200
parents 3236894320d6
children 16aac0287485
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
103
9263b3de37ed fix build on Debian Buster
jodogne
parents:
diff changeset
1 /**
9263b3de37ed fix build on Debian Buster
jodogne
parents:
diff changeset
2 * Orthanc - A Lightweight, RESTful DICOM Store
9263b3de37ed fix build on Debian Buster
jodogne
parents:
diff changeset
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
9263b3de37ed fix build on Debian Buster
jodogne
parents:
diff changeset
4 * Department, University Hospital of Liege, Belgium
193
3236894320d6 upgrade to year 2021
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 177
diff changeset
5 * Copyright (C) 2017-2021 Osimis S.A., Belgium
103
9263b3de37ed fix build on Debian Buster
jodogne
parents:
diff changeset
6 *
9263b3de37ed fix build on Debian Buster
jodogne
parents:
diff changeset
7 * This program is free software: you can redistribute it and/or
9263b3de37ed fix build on Debian Buster
jodogne
parents:
diff changeset
8 * modify it under the terms of the GNU Affero General Public License
9263b3de37ed fix build on Debian Buster
jodogne
parents:
diff changeset
9 * as published by the Free Software Foundation, either version 3 of
9263b3de37ed fix build on Debian Buster
jodogne
parents:
diff changeset
10 * the License, or (at your option) any later version.
9263b3de37ed fix build on Debian Buster
jodogne
parents:
diff changeset
11 *
9263b3de37ed fix build on Debian Buster
jodogne
parents:
diff changeset
12 * This program is distributed in the hope that it will be useful, but
9263b3de37ed fix build on Debian Buster
jodogne
parents:
diff changeset
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
9263b3de37ed fix build on Debian Buster
jodogne
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
9263b3de37ed fix build on Debian Buster
jodogne
parents:
diff changeset
15 * Affero General Public License for more details.
9263b3de37ed fix build on Debian Buster
jodogne
parents:
diff changeset
16 *
9263b3de37ed fix build on Debian Buster
jodogne
parents:
diff changeset
17 * You should have received a copy of the GNU Affero General Public License
9263b3de37ed fix build on Debian Buster
jodogne
parents:
diff changeset
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
9263b3de37ed fix build on Debian Buster
jodogne
parents:
diff changeset
19 **/
9263b3de37ed fix build on Debian Buster
jodogne
parents:
diff changeset
20
9263b3de37ed fix build on Debian Buster
jodogne
parents:
diff changeset
21
9263b3de37ed fix build on Debian Buster
jodogne
parents:
diff changeset
22 #pragma once
9263b3de37ed fix build on Debian Buster
jodogne
parents:
diff changeset
23
108
57c0138d456e fix os x
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 103
diff changeset
24 // These includes are necessary for compilation on OS X
57c0138d456e fix os x
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 103
diff changeset
25 #include <unistd.h>
57c0138d456e fix os x
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 103
diff changeset
26 #include <vector>
57c0138d456e fix os x
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 103
diff changeset
27 #include <map>
57c0138d456e fix os x
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 103
diff changeset
28 #include <cmath>
152
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 140
diff changeset
29 #include <Enumerations.h>
108
57c0138d456e fix os x
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 103
diff changeset
30
177
02ad3ea95fca fix build on ubuntu 16.04
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 176
diff changeset
31 // Get "ntohl()" defined
02ad3ea95fca fix build on ubuntu 16.04
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 176
diff changeset
32 #if defined(_WIN32)
02ad3ea95fca fix build on ubuntu 16.04
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 176
diff changeset
33 # include <winsock.h>
02ad3ea95fca fix build on ubuntu 16.04
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 176
diff changeset
34 #else
02ad3ea95fca fix build on ubuntu 16.04
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 176
diff changeset
35 # include <arpa/inet.h>
02ad3ea95fca fix build on ubuntu 16.04
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 176
diff changeset
36 #endif
02ad3ea95fca fix build on ubuntu 16.04
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 176
diff changeset
37
103
9263b3de37ed fix build on Debian Buster
jodogne
parents:
diff changeset
38 // PostgreSQL includes
9263b3de37ed fix build on Debian Buster
jodogne
parents:
diff changeset
39 #include <pg_config.h>
9263b3de37ed fix build on Debian Buster
jodogne
parents:
diff changeset
40
172
8c7bb94adff7 trying upgrade from libpq 9.6.1 to 13.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 152
diff changeset
41 #if !defined(PG_VERSION_NUM)
8c7bb94adff7 trying upgrade from libpq 9.6.1 to 13.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 152
diff changeset
42 # error PG_VERSION_NUM is not defined
8c7bb94adff7 trying upgrade from libpq 9.6.1 to 13.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 152
diff changeset
43 #endif
8c7bb94adff7 trying upgrade from libpq 9.6.1 to 13.1
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 152
diff changeset
44
177
02ad3ea95fca fix build on ubuntu 16.04
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 176
diff changeset
45 #if PG_VERSION_NUM >= 110000
02ad3ea95fca fix build on ubuntu 16.04
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 176
diff changeset
46 # include <catalog/pg_type_d.h>
02ad3ea95fca fix build on ubuntu 16.04
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 176
diff changeset
47 #else
02ad3ea95fca fix build on ubuntu 16.04
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 176
diff changeset
48 # include <postgres.h>
02ad3ea95fca fix build on ubuntu 16.04
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 176
diff changeset
49 # undef LOG // This one comes from <postgres.h>, and conflicts with <Core/Logging.h>
02ad3ea95fca fix build on ubuntu 16.04
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 176
diff changeset
50 # include <catalog/pg_type.h>
02ad3ea95fca fix build on ubuntu 16.04
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 176
diff changeset
51 #endif
02ad3ea95fca fix build on ubuntu 16.04
Sebastien Jodogne <s.jodogne@gmail.com>
parents: 176
diff changeset
52
103
9263b3de37ed fix build on Debian Buster
jodogne
parents:
diff changeset
53 #include <libpq-fe.h>