Ticket #125 (closed task: fixed)

Opened 4 years ago

Last modified 4 years ago

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.

Attachments

Change History

Changed 4 years ago by mloskot

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.

Changed 4 years ago by mcayland

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

ATB,

Mark.

Changed 4 years ago by mloskot

Mark,

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

Note: See TracTickets for help on using tickets.