diff options
author | Werner Lemberg <wl@gnu.org> | 2015-02-16 11:31:32 +0100 |
---|---|---|
committer | Werner Lemberg <wl@gnu.org> | 2015-02-16 11:31:32 +0100 |
commit | 6f325c26cf3df4e4c7ad97b8bccfdcc096b6637e (patch) | |
tree | 06e54af88ba597ad9c097e8c4d21a51d3aa5f074 /builds | |
parent | 1f377f0d50a6a4bdf2a4985a010af0403925681f (diff) | |
download | freetype2-6f325c26cf3df4e4c7ad97b8bccfdcc096b6637e.tar.gz |
New `TYPEOF' macro.
This helps suppress signedness warnings, avoiding issues with
implicit conversion changes.
* include/config/ftconfig.h, builds/unix/ftconfig.in,
builds/vms/ftconfig.h (TYPEOF): Define.
* include/internal/ftobjs.h (FT_PAD_FLOOR, FT_PIX_FLOOR),
src/autofit/afwarp.h (AF_WARPER_FLOOR): Use it.
Diffstat (limited to 'builds')
-rw-r--r-- | builds/unix/ftconfig.in | 20 | ||||
-rw-r--r-- | builds/vms/ftconfig.h | 18 |
2 files changed, 37 insertions, 1 deletions
diff --git a/builds/unix/ftconfig.in b/builds/unix/ftconfig.in index 6d28b6157..47ca2daf7 100644 --- a/builds/unix/ftconfig.in +++ b/builds/unix/ftconfig.in @@ -89,7 +89,7 @@ FT_BEGIN_HEADER /* is copied from default include/config/ftconfig.h. */ /* If any improvement is required for this file, it should be */ /* applied to the original header file for the builders that */ - /* does not use configure script. */ + /* do not use configure script. */ /* The size of an `int' type. */ #if FT_UINT_MAX == 0xFFFFUL @@ -349,11 +349,29 @@ FT_BEGIN_HEADER #endif + /*************************************************************************/ + /* */ + /* <Section> */ + /* miscellaneous */ + /* */ + /*************************************************************************/ + + #define FT_BEGIN_STMNT do { #define FT_END_STMNT } while ( 0 ) #define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT + /* typeof condition taken from gnulib's `intprops.h' header file */ +#if ( __GNUC__ >= 2 || \ + defined( __IBM__TYPEOF__ ) || \ + ( __SUNPRO_C >= 0x5110 && !__STDC__ ) ) +#define TYPEOF( type, x ) (__typeof__ (type))(x) +#else +#define TYPEOF( type, x ) (x) +#endif + + #ifdef FT_MAKE_OPTION_SINGLE_OBJECT #define FT_LOCAL( x ) static x diff --git a/builds/vms/ftconfig.h b/builds/vms/ftconfig.h index 0e0502856..571c3e505 100644 --- a/builds/vms/ftconfig.h +++ b/builds/vms/ftconfig.h @@ -292,11 +292,29 @@ FT_BEGIN_HEADER #endif + /*************************************************************************/ + /* */ + /* <Section> */ + /* miscellaneous */ + /* */ + /*************************************************************************/ + + #define FT_BEGIN_STMNT do { #define FT_END_STMNT } while ( 0 ) #define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT + /* typeof condition taken from gnulib's `intprops.h' header file */ +#if ( __GNUC__ >= 2 || \ + defined( __IBM__TYPEOF__ ) || \ + ( __SUNPRO_C >= 0x5110 && !__STDC__ ) ) +#define TYPEOF( type, x ) (__typeof__ (type))(x) +#else +#define TYPEOF( type, x ) (x) +#endif + + #ifdef FT_MAKE_OPTION_SINGLE_OBJECT #define FT_LOCAL( x ) static x |