Re: [ft] Freetype2 compilation error

2013-03-20 Thread suzuki toshiya
Dear Amit,

I attached a small C-like source for /bin/cpp,
it checks the maximum bitshift operation that
C preprocessor can work well. Please execute

/bin/cpp ./cpp-bitshift-test.c

and send me its output.

For example, the output by GCC on Linux/i386
finishes as:
---
[snip]
# 2 /dev/shm/cpp-bitshift-test.c 2
/dev/shm/cpp-bitshift-test.c:3:37: warning: integer constant is too large for 
its type [enabled by default]
# 27 /dev/shm/cpp-bitshift-test.c
The max bitshift by C preprocessor would be 63
---
so we can expect that cpp macro like ((ULONG_MAX  63) == 0)
can be used to check the size of unsigned long.

Regards,
mpsuzuki

HCL Infosystems Ltd wrote:
 Dear mpsuzuki,
 
 Thanks a lot for below information.
 
 Regards
 Amit
 
 - Original Message -
 From: suzuki toshiya mpsuz...@hiroshima-u.ac.jp
 To: HCL Infosystems Ltd hpcssupp...@tropmet.res.in
 Cc: Werner LEMBERG w...@gnu.org, freetype freetype@nongnu.org
 Sent: Tuesday, March 19, 2013 6:38:29 PM
 Subject: Re: [ft] Freetype2 compilation error
 
 Dear Amit,
 
 Thank you very much for posting the result of testing tarball.
 I think the compiled FreeType2 binary will work on the platform
 that you executed the configure, but its header files should not
 be shared with different platforms (e.g. sharing the header files
 between 64-bit systems and 32-bit systems would cause a trouble).
 Although I'm not sure whether the mixture of 32-bit AIX and 64-bit
 AIX is popular situation, I wish if FreeType2 could support the
 shared header file in such case, too.
 
 From the messages by testing tarball, I'm afraid that xlc's cpp
 (/bin/cpp) does not work well with the 64-bit constants in C
 preprocessor macro. I will post a few other testing codes...
 Please keep in touch.
 
 Regards,
 mpsuzuki
 
 HCL Infosystems Ltd wrote:
 Dear mpsuzuki,

 Thanks for the below information. Anyways now i am able to compile Freetype2.

 Also find the below is the o/p extracted by configure script:

 ###QUOTE###
 checking whether cpp computation of bit length in ftconfig.in works... ...
 conftest.c is:
 --
 #include limits.h
 #define FT_CONFIG_OPTIONS_H ftoption.h
 #define FT_CONFIG_STANDARD_LIBRARY_H ftstdlib.h
 #define FT_UINT_MAX  UINT_MAX
 #define FT_ULONG_MAX ULONG_MAX
 #include ftconfig.in
 #if FT_SIZEOF_INT == 4
 ac_cpp_ft_sizeof_int=4
 #endif
 #if FT_SIZEOF_LONG == 8
 ac_cpp_ft_sizeof_long=8
 #endif
 --
 execute /bin/cpp -I. -I. -DFT2_CPP_TESTING conftest.c
 result
 --
 #line 234 /usr/include/float.h
 extern  unsigned   int SINFINITY;
 extern  unsigned   int _DBLINF[2];
 extern  unsigned   int SQNAN;
 extern  unsigned   int DQNAN[2];
 extern  unsigned   int SSNAN;
 extern  unsigned   int DSNAN[2];
 #line 265
 typedef unsigned short fprnd_t;
 #line 274
 fprnd_t fp_read_rnd(void);
 fprnd_t fp_swap_rnd(fprnd_t rnd);
 #line 45 ftconfig.in
 FT_BEGIN_HEADER
 #line 182
   typedef signed shortFT_Int16;
   typedef unsigned short  FT_UInt16;
 #line 187
   typedef signed int  FT_Int32;
   typedef unsigned intFT_UInt32;
 #line 203
   typedef intFT_Fast;
   typedef unsigned int   FT_UFast;
 #line 538
 FT_END_HEADER
 #line 8 conftest.c
 ac_cpp_ft_sizeof_int=4
 --
 ac_cpp_ft_sizeof_int = 4
 ac_cpp_ft_sizeof_long =
 :ft_use_autoconf_sizeof_types:enable_biarch_config:=:yes::
 checking whether cpp computation of bit length in ftconfig.in works... no
 checking for stdlib.h... (cached) yes
 checking for unistd.h... (cached) yes
 ###UNQUOTE###

 Regards
 Amit

 - Original Message -
 From: suzuki toshiya mpsuz...@hiroshima-u.ac.jp
 To: HCL Infosystems Ltd hpcssupp...@tropmet.res.in
 Cc: Werner LEMBERG w...@gnu.org, freetype freetype@nongnu.org
 Sent: Tuesday, March 19, 2013 3:53:47 PM
 Subject: Re: [ft] Freetype2 compilation error

 Dear Amit,

 Thank you very much for kind accept.
 I uploaded yet another testing tarball,
 http://gyvern.ipc.hiroshima-u.ac.jp/~mpsuzuki/freetype-2.4.11_fix-for-xlc-cpp_20130319b.tar.xz

 Its configure prints additional information about the integer
 size checking by cpp, as following. Please post the messages
 generated by configure script. In this time, no need to post
 config.log. Thanks in advance!

 # I phoned to IBM Japan and ask whether they still provide
 # porting centre servicesthat they had ever provided
 # 10 years ago, for the developers porting the softwares onto
 # AIX. Unfortunately, they replied the current service is only
 # for the software companies, so the people from public sectors
 # or research institute could 

Re: [ft] Freetype2 compilation error

2013-03-20 Thread HCL Infosystems Ltd
#include limits.h

#if !(0x  64)  (0x1  64)
# define CPP_MAX_BITSHIFT 64
#elif !(0x7FFF  63)  (0x  63)
# define CPP_MAX_BITSHIFT 63
#elif !(0x  48)  (0x1  48)
# define CPP_MAX_BITSHIFT 48
#elif !(0x7FFF  47)  (0x  47)
# define CPP_MAX_BITSHIFT 47
#elif !(0x  32)  (0x1  32)
# define CPP_MAX_BITSHIFT 32
#elif !(0x7FFF  31)  (0x  31)
# define CPP_MAX_BITSHIFT 31
#elif !(0xFF  24)  (0x100  24)
# define CPP_MAX_BITSHIFT 24
#elif !(0x7F  23)  (0xFF  23)
# define CPP_MAX_BITSHIFT 23
#elif !(0xFF  16)  (0x100  16)
# define CPP_MAX_BITSHIFT 16
#elif !(0x7F  15)  (0xFF  15)
# define CPP_MAX_BITSHIFT 15
#else
# define CPP_MAX_BITSHIFT 0
#endif

The max bitshift by C preprocessor would be CPP_MAX_BITSHIFT
___
Freetype mailing list
Freetype@nongnu.org
https://lists.nongnu.org/mailman/listinfo/freetype


Re: [ft] Freetype2 compilation error

2013-03-20 Thread suzuki toshiya
Dear Amit,

Thanks! It seems that xlc's cpp cannot handle bitshift for
64-bit constants, at least, if the constants lack the suffix
for long (or unsigned long) integer. I attached yet another
testing code that the constants greater than 32-bit range
have the suffix L to indicate long type. Could you execute
/bin/cpp ./cpp-bitshift-test2.c
again?

Regards,
mpsuzuki

HCL Infosystems Ltd wrote:
 Dear mpsuzuki,
 
 Please find the below o/p of '/bin/cpp ./cpp-bitshift-test.c' command:
 
 ###QUOTE###
 #line 234 /usr/include/float.h
 extern  unsigned   int SINFINITY;
 extern  unsigned   int _DBLINF[2];
 extern  unsigned   int SQNAN;
 extern  unsigned   int DQNAN[2];
 extern  unsigned   int SSNAN;
 extern  unsigned   int DSNAN[2];
 #line 265
 typedef unsigned short fprnd_t;
 #line 274
 fprnd_t fp_read_rnd(void);
 fprnd_t fp_swap_rnd(fprnd_t rnd);
 ./cpp-bitshift-test.c, line 3.7: 1506-207 (W) Integer constant 
 0x out of range.
 ./cpp-bitshift-test.c, line 3.37: 1506-207 (W) Integer constant 
 0x1 out of range.
 ./cpp-bitshift-test.c, line 5.9: 1506-207 (W) Integer constant 
 0x7FFF out of range.
 ./cpp-bitshift-test.c, line 5.39: 1506-207 (W) Integer constant 
 0x out of range.
 ./cpp-bitshift-test.c, line 7.9: 1506-207 (W) Integer constant 
 0x out of range.
 ./cpp-bitshift-test.c, line 7.35: 1506-207 (W) Integer constant 
 0x1 out of range.
 ./cpp-bitshift-test.c, line 9.9: 1506-207 (W) Integer constant 
 0x7FFF out of range.
 ./cpp-bitshift-test.c, line 9.35: 1506-207 (W) Integer constant 
 0x out of range.
 ./cpp-bitshift-test.c, line 11.31: 1506-207 (W) Integer constant 
 0x1 out of range.
 #line 27 ./cpp-bitshift-test.c
 The max bitshift by C preprocessor would be 31
 ###UNQUOTE###
 
 Regards
 Amit
 
 - Original Message -
 From: suzuki toshiya mpsuz...@hiroshima-u.ac.jp
 To: HCL Infosystems Ltd hpcssupp...@tropmet.res.in
 Cc: Werner LEMBERG w...@gnu.org, freetype freetype@nongnu.org
 Sent: Wednesday, March 20, 2013 2:38:05 PM
 Subject: Re: [ft] Freetype2 compilation error
 
 Dear Amit,
 
 I attached a small C-like source for /bin/cpp,
 it checks the maximum bitshift operation that
 C preprocessor can work well. Please execute
 
 /bin/cpp ./cpp-bitshift-test.c
 
 and send me its output.
 
 For example, the output by GCC on Linux/i386
 finishes as:
 ---
 [snip]
 # 2 /dev/shm/cpp-bitshift-test.c 2
 /dev/shm/cpp-bitshift-test.c:3:37: warning: integer constant is too large for 
 its type [enabled by default]
 # 27 /dev/shm/cpp-bitshift-test.c
 The max bitshift by C preprocessor would be 63
 ---
 so we can expect that cpp macro like ((ULONG_MAX  63) == 0)
 can be used to check the size of unsigned long.
 
 Regards,
 mpsuzuki
 
 HCL Infosystems Ltd wrote:
 Dear mpsuzuki,

 Thanks a lot for below information.

 Regards
 Amit

 - Original Message -
 From: suzuki toshiya mpsuz...@hiroshima-u.ac.jp
 To: HCL Infosystems Ltd hpcssupp...@tropmet.res.in
 Cc: Werner LEMBERG w...@gnu.org, freetype freetype@nongnu.org
 Sent: Tuesday, March 19, 2013 6:38:29 PM
 Subject: Re: [ft] Freetype2 compilation error

 Dear Amit,

 Thank you very much for posting the result of testing tarball.
 I think the compiled FreeType2 binary will work on the platform
 that you executed the configure, but its header files should not
 be shared with different platforms (e.g. sharing the header files
 between 64-bit systems and 32-bit systems would cause a trouble).
 Although I'm not sure whether the mixture of 32-bit AIX and 64-bit
 AIX is popular situation, I wish if FreeType2 could support the
 shared header file in such case, too.

 From the messages by testing tarball, I'm afraid that xlc's cpp
 (/bin/cpp) does not work well with the 64-bit constants in C
 preprocessor macro. I will post a few other testing codes...
 Please keep in touch.

 Regards,
 mpsuzuki

 HCL Infosystems Ltd wrote:
 Dear mpsuzuki,

 Thanks for the below information. Anyways now i am able to compile 
 Freetype2.

 Also find the below is the o/p extracted by configure script:

 ###QUOTE###
 checking whether cpp computation of bit length in ftconfig.in works... ...
 conftest.c is:
 --
 #include limits.h
 #define FT_CONFIG_OPTIONS_H ftoption.h
 #define FT_CONFIG_STANDARD_LIBRARY_H ftstdlib.h
 #define FT_UINT_MAX  UINT_MAX
 #define FT_ULONG_MAX ULONG_MAX
 #include ftconfig.in
 #if FT_SIZEOF_INT == 4
 ac_cpp_ft_sizeof_int=4
 #endif
 #if FT_SIZEOF_LONG == 8
 ac_cpp_ft_sizeof_long=8
 #endif
 

Re: [ft] Freetype2 compilation error

2013-03-20 Thread HCL Infosystems Ltd
#include limits.h

#if !(0xL  64)  (0x1L  64)
# define CPP_MAX_BITSHIFT 64
#elif !(0x7FFFL  63)  (0xL  63)
# define CPP_MAX_BITSHIFT 63
#elif !(0xL  48)  (0x1L  48)
# define CPP_MAX_BITSHIFT 48
#elif !(0x7FFFL  47)  (0xL  47)
# define CPP_MAX_BITSHIFT 47
#elif !(0xL  32)  (0x1L  32)
# define CPP_MAX_BITSHIFT 32
#elif !(0x7FFFL  31)  (0xL  31)
# define CPP_MAX_BITSHIFT 31
#elif !(0xFF  24)  (0x100  24)
# define CPP_MAX_BITSHIFT 24
#elif !(0x7F  23)  (0xFF  23)
# define CPP_MAX_BITSHIFT 23
#elif !(0xFF  16)  (0x100  16)
# define CPP_MAX_BITSHIFT 16
#elif !(0x7F  15)  (0xFF  15)
# define CPP_MAX_BITSHIFT 15
#else
# define CPP_MAX_BITSHIFT 0
#endif

The max bitshift by C preprocessor would be CPP_MAX_BITSHIFT
___
Freetype mailing list
Freetype@nongnu.org
https://lists.nongnu.org/mailman/listinfo/freetype


Re: [ft] Freetype2 compilation error

2013-03-20 Thread suzuki toshiya
Dear Amit,

Thanks again! According to the line

 ./cpp-bitshift-test2.c, line 11.32: 1506-207 (W) Integer constant 
 0x1L out of range.

the integer constant greater than 32-bit is inappropriate
for xlc's cpp. I think FreeType2 header for xlc should not
be shared between 32-bit and 64-bit systems. I will investigate
any predefined macros to detect xlc (or the case that the
max sizes of the integer constants are different between
cpp  C compiler), but the immediate fix for the next release
of FreeType2 would disable the bi-arch header file.

Regards,
mpsuzuki

HCL Infosystems Ltd wrote:
 Dear mpsuzuki,
 
 Please find the below o/p:
 
 ###QUOTE###
 #line 234 /usr/include/float.h
 extern  unsigned   int SINFINITY;
 extern  unsigned   int _DBLINF[2];
 extern  unsigned   int SQNAN;
 extern  unsigned   int DQNAN[2];
 extern  unsigned   int SSNAN;
 extern  unsigned   int DSNAN[2];
 #line 265
 typedef unsigned short fprnd_t;
 #line 274
 fprnd_t fp_read_rnd(void);
 fprnd_t fp_swap_rnd(fprnd_t rnd);
 ./cpp-bitshift-test2.c, line 3.7: 1506-207 (W) Integer constant 
 0xL out of range.
 ./cpp-bitshift-test2.c, line 3.38: 1506-207 (W) Integer constant 
 0x1L out of range.
 ./cpp-bitshift-test2.c, line 5.9: 1506-207 (W) Integer constant 
 0x7FFFL out of range.
 ./cpp-bitshift-test2.c, line 5.40: 1506-207 (W) Integer constant 
 0xL out of range.
 ./cpp-bitshift-test2.c, line 7.9: 1506-207 (W) Integer constant 
 0xL out of range.
 ./cpp-bitshift-test2.c, line 7.36: 1506-207 (W) Integer constant 
 0x1L out of range.
 ./cpp-bitshift-test2.c, line 9.9: 1506-207 (W) Integer constant 
 0x7FFFL out of range.
 ./cpp-bitshift-test2.c, line 9.36: 1506-207 (W) Integer constant 
 0xL out of range.
 ./cpp-bitshift-test2.c, line 11.32: 1506-207 (W) Integer constant 
 0x1L out of range.
 #line 27 ./cpp-bitshift-test2.c
 The max bitshift by C preprocessor would be 31
 ###UNQUOTE###
 
 Regards
 Amit
 
 - Original Message -
 From: suzuki toshiya mpsuz...@hiroshima-u.ac.jp
 To: HCL Infosystems Ltd hpcssupp...@tropmet.res.in
 Cc: Werner LEMBERG w...@gnu.org, freetype freetype@nongnu.org
 Sent: Wednesday, March 20, 2013 3:42:08 PM
 Subject: Re: [ft] Freetype2 compilation error
 
 Dear Amit,
 
 Thanks! It seems that xlc's cpp cannot handle bitshift for
 64-bit constants, at least, if the constants lack the suffix
 for long (or unsigned long) integer. I attached yet another
 testing code that the constants greater than 32-bit range
 have the suffix L to indicate long type. Could you execute
 /bin/cpp ./cpp-bitshift-test2.c
 again?
 
 Regards,
 mpsuzuki
 
 HCL Infosystems Ltd wrote:
 Dear mpsuzuki,

 Please find the below o/p of '/bin/cpp ./cpp-bitshift-test.c' command:

 ###QUOTE###
 #line 234 /usr/include/float.h
 extern  unsigned   int SINFINITY;
 extern  unsigned   int _DBLINF[2];
 extern  unsigned   int SQNAN;
 extern  unsigned   int DQNAN[2];
 extern  unsigned   int SSNAN;
 extern  unsigned   int DSNAN[2];
 #line 265
 typedef unsigned short fprnd_t;
 #line 274
 fprnd_t fp_read_rnd(void);
 fprnd_t fp_swap_rnd(fprnd_t rnd);
 ./cpp-bitshift-test.c, line 3.7: 1506-207 (W) Integer constant 
 0x out of range.
 ./cpp-bitshift-test.c, line 3.37: 1506-207 (W) Integer constant 
 0x1 out of range.
 ./cpp-bitshift-test.c, line 5.9: 1506-207 (W) Integer constant 
 0x7FFF out of range.
 ./cpp-bitshift-test.c, line 5.39: 1506-207 (W) Integer constant 
 0x out of range.
 ./cpp-bitshift-test.c, line 7.9: 1506-207 (W) Integer constant 
 0x out of range.
 ./cpp-bitshift-test.c, line 7.35: 1506-207 (W) Integer constant 
 0x1 out of range.
 ./cpp-bitshift-test.c, line 9.9: 1506-207 (W) Integer constant 
 0x7FFF out of range.
 ./cpp-bitshift-test.c, line 9.35: 1506-207 (W) Integer constant 
 0x out of range.
 ./cpp-bitshift-test.c, line 11.31: 1506-207 (W) Integer constant 
 0x1 out of range.
 #line 27 ./cpp-bitshift-test.c
 The max bitshift by C preprocessor would be 31
 ###UNQUOTE###

 Regards
 Amit

 - Original Message -
 From: suzuki toshiya mpsuz...@hiroshima-u.ac.jp
 To: HCL Infosystems Ltd hpcssupp...@tropmet.res.in
 Cc: Werner LEMBERG w...@gnu.org, freetype freetype@nongnu.org
 Sent: Wednesday, March 20, 2013 2:38:05 PM
 Subject: Re: [ft] Freetype2 compilation error

 Dear Amit,

 I attached a small C-like source for /bin/cpp,
 it checks the maximum bitshift operation that
 C preprocessor can work