postgresql/contrib/seg
Tom Lane c8e81afc60 Convert contrib/seg's bool-returning SQL functions to V1 call convention.
It appears that we can no longer get away with using V0 call convention
for bool-returning functions in newer versions of MSVC.  The compiler
seems to generate code that doesn't clear the higher-order bits of the
result register, causing the bool result Datum to often read as "true"
when "false" was intended.  This is not very surprising, since the
function thinks it's returning a bool-width result but fmgr_oldstyle
assumes that V0 functions return "char *"; what's surprising is that
that hack worked for so long on so many platforms.

The only functions of this description in core+contrib are in contrib/seg,
which we'd intentionally left mostly in V0 style to serve as a warning
canary if V0 call convention breaks.  We could imagine hacking things
so that they're still V0 (we'd have to redeclare the bool-returning
functions as returning some suitably wide integer type, like size_t,
at the C level).  But on the whole it seems better to convert 'em to V1.
We can still leave the pointer- and int-returning functions in V0 style,
so that the test coverage isn't gone entirely.

Back-patch to 9.5, since our intention is to support VS2015 in 9.5
and later.  There's no SQL-level change in the functions' behavior
so back-patching should be safe enough.

Discussion: <22094.1461273324@sss.pgh.pa.us>

Michael Paquier, adjusted some by me
2016-04-22 11:54:23 -04:00
..
data Modify the float4 datatype to be pass-by-val. Along the way, remove the last 2008-04-18 18:43:09 +00:00
expected Convert contrib modules to use the extension facility. 2011-02-13 22:54:49 -05:00
sql Convert contrib modules to use the extension facility. 2011-02-13 22:54:49 -05:00
.gitignore Support "make check" in contrib 2011-04-25 22:27:11 +03:00
Makefile Add file version information to most installed Windows binaries. 2014-07-14 14:07:52 -04:00
seg--1.0.sql Fix assorted inconsistencies in GiST opclass support function declarations. 2016-01-19 12:04:36 -05:00
seg--unpackaged--1.0.sql Fix typos in some error messages thrown by extension scripts when fed to psql. 2014-08-25 18:30:37 +02:00
seg-validate.pl Run newly-configured perltidy script on Perl files. 2012-07-04 21:47:49 -04:00
seg.c Convert contrib/seg's bool-returning SQL functions to V1 call convention. 2016-04-22 11:54:23 -04:00
seg.control Convert contrib modules to use the extension facility. 2011-02-13 22:54:49 -05:00
segdata.h Tweak __attribute__-wrapping macros for better pgindent results. 2015-03-26 14:03:25 -04:00
segparse.y Tweak __attribute__-wrapping macros for better pgindent results. 2015-03-26 14:03:25 -04:00
segscan.l Tweak __attribute__-wrapping macros for better pgindent results. 2015-03-26 14:03:25 -04:00
sort-segments.pl Run newly-configured perltidy script on Perl files. 2012-07-04 21:47:49 -04:00