Provide separate header file for built-in float types
authorTomas Vondra <tomas.vondra@postgresql.org>
Sun, 29 Jul 2018 01:30:48 +0000 (03:30 +0200)
committerTomas Vondra <tomas.vondra@postgresql.org>
Sun, 29 Jul 2018 01:30:48 +0000 (03:30 +0200)
commit6bf0bc842bd75877e31727eb559c6a69e237f831
treeff722cf14f3bc7338d91ea219041d362c9c56d7b
parenta7dc63d904a6044d299aebdf59ad3199b6a9e99d
Provide separate header file for built-in float types

Some data types under adt/ have separate header files, but most simple
ones do not, and their public functions are defined in builtins.h.  As
the patches improving geometric types will require making additional
functions public, this seems like a good opportunity to create a header
for floats types.

Commit 1acf757255 made _cmp functions public to solve NaN issues locally
for GiST indexes.  This patch reworks it in favour of a more widely
applicable API.  The API uses inline functions, as they are easier to
use compared to macros, and avoid double-evaluation hazards.

Author: Emre Hasegeli
Reviewed-by: Kyotaro Horiguchi
Discussion: https://www.postgresql.org/message-id/CAE2gYzxF7-5djV6-cEvqQu-fNsnt%3DEqbOURx7ZDg%2BVv6ZMTWbg%40mail.gmail.com
20 files changed:
contrib/btree_gin/btree_gin.c
contrib/btree_gist/btree_ts.c
contrib/cube/cube.c
contrib/cube/cubeparse.y
contrib/postgres_fdw/postgres_fdw.c
src/backend/access/gist/gistget.c
src/backend/access/gist/gistproc.c
src/backend/access/gist/gistutil.c
src/backend/utils/adt/float.c
src/backend/utils/adt/formatting.c
src/backend/utils/adt/geo_ops.c
src/backend/utils/adt/geo_spgist.c
src/backend/utils/adt/numeric.c
src/backend/utils/adt/rangetypes_gist.c
src/backend/utils/adt/rangetypes_selfuncs.c
src/backend/utils/adt/rangetypes_typanalyze.c
src/backend/utils/adt/timestamp.c
src/backend/utils/misc/guc.c
src/include/utils/builtins.h
src/include/utils/float.h [new file with mode: 0644]