Re: [GENERAL] Re: Errors in Postgres

Поиск
Список
Период
Сортировка
От Michael Simms
Тема Re: [GENERAL] Re: Errors in Postgres
Дата
Msg-id 199910241419.PAA06008@argh.demon.co.uk
обсуждение исходный текст
Ответ на Re: Errors in Postgres  (Bruce Momjian <maillist@candle.pha.pa.us>)
Список pgsql-general
>
> 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

В списке pgsql-general по дате отправления:

Предыдущее
От: Martin Weinberg
Дата:
Сообщение: Re: [GENERAL] Re: Errors in Postgres
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [INTERFACES] Re: Errors in Postgres