I tried to define type width after getting error like: The definition for <...> is missing.


16 августа 2011, 01:14 от Marc Feeley <feeley@iro.umontreal.ca>:

On 2011-08-15, at 4:12 PM, Кириенко Олег wrote:

> Thank you for your answer. Your script was usefull to move forward.
>
> I have also added:
>
> echo "#ifndef ___CHAR_WIDTH" >> include/gambit.h
> echo "#define ___CHAR_WIDTH 8" >> include/gambit.h
> echo "#endif" >> include/gambit.h
>
> echo "#ifndef ___SHORT_WIDTH" >> include/gambit.h
> echo "#define ___SHORT_WIDTH 16" >> include/gambit.h
> echo "#endif" >> include/gambit.h
>
> echo "#ifndef ___INT_WIDTH" >> include/gambit.h
> echo "#define ___INT_WIDTH 32" >> include/gambit.h
> echo "#endif" >> include/gambit.h
>
> echo "#ifndef ___LONG_WIDTH" >> include/gambit.h
> echo "#define ___LONG_WIDTH 32" >> include/gambit.h
> echo "#endif" >> include/gambit.h
>
> echo "#ifndef ___LONGLONG_WIDTH" >> include/gambit.h
> echo "#define ___LONGLONG_WIDTH 32" >> include/gambit.h
> echo "#endif" >> include/gambit.h
>
> echo "#ifndef ___FLOAT_WIDTH" >> include/gambit.h
> echo "#define ___FLOAT_WIDTH 32" >> include/gambit.h
> echo "#endif" >> include/gambit.h
>
> echo "#ifndef ___DOUBLE_WIDTH" >> include/gambit.h
> echo "#define ___DOUBLE_WIDTH 64" >> include/gambit.h
> echo "#endif" >> include/gambit.h
>
> And I had a problem with wchar_t so I have added -D___DONT_HAVE_WCHAR_H
>
> Now I have a problem with S64/U64 because Watcom 10.6 (the only compiler available) on QNX doesn't support long long and any other 64 bit values.
>
> Is it possible build without 64bit?

You shouldn't define the symbols ___XXX_WIDTH. The gambit.h header file will figure out what the widths are using limits.h . Among other things you are defining ___LONGLONG_WIDTH, and this makes gambit.h think that the "long long" type is available.

On systems where "long long" is not available, gambit.h will substitute the type "long". Moreover, 64 bit arithmetic (S64/U64) is performed using a structure containing two 32 bit ints.

Marc


--