From: Michael Simms <grim@argh.demon.co.uk>
To: maillist@candle.pha.pa.us
Cc: oleg@pine.krs.ru
Cc: vadim@krs.ru
Cc: pgsql-interfaces@postgreSQL.org
Cc: pgsql-general@postgreSQL.org
Subject: Re: [GENERAL] Re: Errors in Postgres
Date: Sun, 24 Oct 1999 15:19:55 +0100 (BST)
Message-ID: <199910241419.PAA06008@argh.demon.co.uk> (raw)
In-Reply-To: <199910241242.IAA14822@candle.pha.pa.us>
>
> 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: grim@argh.demon.co.uk, maillist@candle.pha.pa.us, oleg@pine.krs.ru, vadim@krs.ru, pgsql-general@postgreSQL.org
Subject: Re: [GENERAL] Re: Errors in Postgres
In-Reply-To: <199910241419.PAA06008@argh.demon.co.uk>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox