Xcode compile error with postgres.h and pg_type.h

From: bradg <bg4all(at)me(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Xcode compile error with postgres.h and pg_type.h
Date: 2016-02-06 17:42:28
Message-ID: 1454780548529-5886128.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

I am trying to include the following PostgreSQL headers files into my Xcode
7.2 project:

#import "postgres.h"
#import "pg_type.h"
#import "libpq-fe.h"

The app is written in Swift. I have an Objective-C bridging header. If I
just import "libpq-fe.h" there are no compile errors.

When I try to import "postgres.h" and "pg_types.h" to get access to certain
constants, I get an error with a PostgreSQL file: "c.h"

"Typedef redefinition with different types ('size_t' (aka 'unsigned long')
vs 'long')

The previous definition is in OS X 10.11 > user/include > MacTypes.h

So there are two headers with the same definition:

PostgreSQL > c.h
typedef size_t Size

OSX > MacTypes.h
typedef long Size

If I comment out the definition in the PostgreSQL file then the project
compiles. But I don't want to do that, I was just curious.

Does anyone know a way around this?

Merlin-moncure mentioned using a 'backend header' but so far I have not been
able to figure this out.

Thanks in advance.

--
View this message in context: http://postgresql.nabble.com/Xcode-compile-error-with-postgres-h-and-pg-type-h-tp5886128.html
Sent from the PostgreSQL - novice mailing list archive at Nabble.com.

Browse pgsql-novice by date

  From Date Subject
Next Message Griffin, Jimmy (NIH/NIAID) [C] 2016-02-08 20:12:33 How to use pg_ldap_sync
Previous Message Tom Lane 2016-02-05 03:50:48 Re: relaxed full text search?