Opened 16 years ago

Last modified 16 years ago

#125 closed task (fixed)

postgres.h header isnot included first

Reported by: mloskot Owned by:
Priority: medium Milestone: PostGIS 1.4.0
Component: postgis Version: 1.4
Keywords: Cc:

Description

Note that you should always include postgres.h first in any source file, because it declares a number of things that you will need anyway.

Change History (4)

comment:1 by mloskot, 16 years ago

I'm sorry, but apparently I've had no idea that Google Code magically reacts on some keystrokes, so I accidentally submitted incomplete report.

The problem is that PostGIS sources does NOT include postgres.h header first, on top of other source files, as chapter 34.9.2. 'Base Types in C-Language Function' of PostgreSQL manual specifies:

Note that you should always include postgres.h first in any source file, because it declares a number of things that you will need anyway.

This causes number of problems while building PostGIS using Microsoft Visual C++ (8.0) compiler.

I attached patch I generated against recent svn trunk revision and tested on Linux.

comment:2 by mcayland, 16 years ago

This looks fine to me, and compiles without any issues here. Applied to SVN trunk.

ATB,

Mark.

comment:3 by mloskot, 16 years ago

Mark,

Thanks for patching this. I confirm it works for me as well.

Note: See TracTickets for help on using tickets.