Re[8]: SPI_getvalue problem

From: Alex Guryanow <gav(at)nlr(dot)ru>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re[8]: SPI_getvalue problem
Date: 2001-01-29 15:29:34
Message-ID: 7770.010129@nlr.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Monday, January 29, 2001, 5:40:46 PM, you wrote:

TL> Alex Guryanow <gav(at)nlr(dot)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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2001-01-29 15:30:55 Re: : Execute a string of command in sql'script
Previous Message Stephane Bortzmeyer 2001-01-29 15:24:24 Re: Consulta.