Missing include in float.h

Started by Ian R. Campbellabout 4 years ago2 messagesbugs
Jump to latest
#1Ian R. Campbell
ian.campbell@thepathcentral.com

In PG 14, the source file "float.h" has one include:

<math.h>

It is missing "c.h", which contains the definitions for PGDLLIMPORT,
float4, float8, etc.

I have the latest Windows installation from EDB.

I checked in doxygen and the include is missing there, too:
https://doxygen.postgresql.org/float_8h_source.html

Best,
Ian Campbell

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Ian R. Campbell (#1)
Re: Missing include in float.h

"Ian R. Campbell" <ian.campbell@thepathcentral.com> writes:

In PG 14, the source file "float.h" has one include:
<math.h>

It is missing "c.h", which contains the definitions for PGDLLIMPORT,
float4, float8, etc.

This is standard practice in our header files: they assume that
the calling .c file has already included c.h, postgres.h, or
postgres_fe.h, as appropriate.

There are some portability hacks in c.h that don't work if any
other header is included first, so there would be little
value in trying to include it via other methods.

regards, tom lane