Huong Dangminh <huo-dangminh@ys.jp.nec.com> writes:
> From: Tom Lane [mailto:tgl@sss.pgh.pa.us]
>> Well, we committed *something* about that:
>> https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=fda3e65786763bd43abc576a23035a4cd24ed138
>> Does that not match the fix you were using?
> I confirmed that the above commit fix the case of not define HAVE_LONG_LONG_INT.
> But We found another case that causes "unsupported type "long long"" error in
> Windows environment.
> In our case, We got the same error "unsupported type ...", because of the flag
> HAVE_STRTOLL and HAVE_STRTOULL are not defined (*1).
Ah! I looked through the uses of ECPG_UNSUPPORTED, and that seems to be
the only other thing that needs to be covered.
> I created a patch which defines the above two flags in Visual Studio 2013 or greater.
> # The two functions strtoll and strtoull are support from Visual Studio 2013
> Please confirm the attached.
It seems fairly unfortunate that this patch does not fix the problem
for as far back as MSVC has "long long" support. From what I can tell,
we could use _strtoi64 and _strtoui64 on older Windows versions. So
I'm imagining something like
#if (_MSC_VER > 1200)
#define HAVE_LONG_LONG_INT_64 1
#endif
...
#ifdef HAVE_LONG_LONG_INT_64
#define HAVE_STRTOLL 1
/* Before VS2013, use Microsoft's nonstandard equivalent function */
#if (_MSC_VER < 1800)
#define strtoll _strtoi64
#endif
#endif
and similarly for strtoull.
Please check that and see if it works.
BTW, is it possible to set up an ecpg test case to verify that this
stuff works? It'd have to handle platforms without long long though,
so I'm not sure how to deal with that.
regards, tom lane