Re[8]: SPI_getvalue problem - Mailing list pgsql-general

From Alex Guryanow
Subject Re[8]: SPI_getvalue problem
Date
Msg-id 7770.010129@nlr.ru
Whole thread Raw
In response to Re: Re[6]: SPI_getvalue problem  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Re[8]: SPI_getvalue problem
List pgsql-general
Monday, January 29, 2001, 5:40:46 PM, you wrote:

TL> Alex Guryanow <gav@nlr.ru> writes:
>> By the way. To compile using g++ I have added two lines to
>> src/include/nodes/parsenodes.h:

TL> How big does g++ think type bool is?  There are several bool fields
TL> in struct RelationData ...

It thinks bool is 4 bytes long:

--- a.cpp ---
#include <stdio.h>
int main(void)
{
    printf("sizeof(bool) = %d\n", sizeof(bool));
    return 0;
}
--- make command ---
g++ a.cpp
--- results ---
sizeof(bool) = 4

And /src/include/c.h from postgres distribution contains

#ifndef __cplusplus
#ifndef bool
typedef char bool;
#endif
#endif

What should I do to be able to compile my function using g++?
Should I make changes in c.h to define bool as int and then rebuild
backend? Or this is a bad idea?

Best regards,
Alex



pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: : Execute a string of command in sql'script
Next
From: Tom Lane
Date:
Subject: Re: Re[8]: SPI_getvalue problem