Re: [GENERAL] Re: Errors in Postgres

From: Michael Simms <grim(at)argh(dot)demon(dot)co(dot)uk>
To: maillist(at)candle(dot)pha(dot)pa(dot)us (Bruce Momjian)
Cc: oleg(at)pine(dot)krs(dot)ru, vadim(at)krs(dot)ru, pgsql-interfaces(at)postgreSQL(dot)org, pgsql-general(at)postgreSQL(dot)org
Subject: Re: [GENERAL] Re: Errors in Postgres
Date: 1999-10-24 14:19:55
Message-ID: 199910241419.PAA06008@argh.demon.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-interfaces

>
> This is a standard C++ problem. Some platforms need string.h, and some
> just string. We have not figured out a way to make this work on all
> platforms.
>
> Any ideas? We kept switching them back and forth until we realized
> this. Sun's seem to have the problem.
>

Why not just add an extra thing into the config scripts. Something like:

echo '#include <string.h>' > test.c
echo 'int main(int argc,char **argv) {' >> test.c

Something here where you have a clash...

echo 'return 1;}' >> test.c

$CC test.c -o test

if [ -f test ]
then
echo '#define NEED_STRING_H' >> someheader.h
else
echo '#include <string.h>' > test.c
echo 'int main(int argc,char **argv) {' >> test.c

Something here where you have a clash...

echo 'return 1;}' >> test.c

$CC test.c -o test

if [ -f test ]
then
echo '#define NEED_STRING' >> someheader.h
else
echo '#define UNKNOWN_STRING' >> soneheader.h
fi
fi

and then in your main program files

#include "someheader.h"

#ifdef NEED_STRING
#include <string>
#endif
#ifdef NEED_STRING_H
#include <string.h>
#endif

This is how I test for things like that. OK so I wrote all of my config stuff
before I knew about gnu's autoconf, and to be honest I dont know how well
this would integrate with that, but it works for me to compile my own
projects on just about any un*x flavor Ive been able to get access
too, plus cygwin32

~Michael

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 1999-10-24 15:54:54 Re: [INTERFACES] Re: Errors in Postgres
Previous Message D'Arcy J.M. Cain 1999-10-24 12:43:00 Re: [INTERFACES] Errors in Postgres

Browse pgsql-interfaces by date

  From Date Subject
Next Message Tom Lane 1999-10-24 15:54:54 Re: [INTERFACES] Re: Errors in Postgres
Previous Message Oscar Overdijk 1999-10-24 12:44:54 Pgaccess