Fix gcc-3.3 versions of macros to have the right return value.

Mon Sep 15 17:16:59 2003  Owen Taylor  <otaylor@redhat.com>

        * pango/opentype/fterrcompat.h: Fix gcc-3.3 versions of
        macros to have the right return value.
This commit is contained in:
Owen Taylor 2003-09-15 22:04:55 +00:00 committed by Owen Taylor
parent c99259bf7e
commit 558171a7a3
1 changed files with 26 additions and 18 deletions

View File

@ -34,30 +34,38 @@
* use them when necessary * use them when necessary
*/ */
#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3) #if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)
#define ALLOC_ARRAY( _pointer_, _count_, _type_ ) ({ \ #define ALLOC_ARRAY( _pointer_, _count_, _type_ ) ({ \
void *_tmp_; \ int result; \
FT_SET_ERROR (FT_MEM_ALLOC_ARRAY( _tmp_, _count_, _type_ )); \ void *_tmp_; \
_pointer_ = _tmp_; \ result = FT_SET_ERROR ( FT_MEM_ALLOC_ARRAY ( _tmp_, \
_count_, \
_type_ ) ); \
_pointer_ = _tmp_; \
result; \
}) })
/* FT_MEM_REALLOC macro broken in 2.1.0 */ /* FT_MEM_REALLOC macro broken in 2.1.0 */
#define REALLOC_ARRAY( _pointer_, _old_, _new_, _type_ ) ({ \ #define REALLOC_ARRAY( _pointer_, _old_, _new_, _type_ ) ({ \
void *_tmp_; \ int result; \
FT_SET_ERROR ( FT_MEM_REALLOC( _tmp_, \ void *_tmp_ = _pointer_; \
(_old_) * sizeof ( _type_ ), \ result = FT_SET_ERROR ( FT_MEM_REALLOC( _tmp_, \
(_new_) * sizeof ( _type_ ) ) ); \ (_old_) * sizeof ( _type_ ), \
_pointer_ = _tmp_; \ (_new_) * sizeof ( _type_ ) ) ); \
_pointer_ = _tmp_; \
result; \
}) })
#define FREE( _pointer_ ) ({ \ #define FREE( _pointer_ ) ({ \
void *_tmp_ = _pointer_; \ void *_tmp_ = _pointer_; \
FT_FREE ( _tmp_ ); \ FT_FREE ( _tmp_ ); \
_pointer_ = _tmp_; \ _pointer_ = _tmp_; \
}) })
#define ALLOC( _pointer_, _size_ ) ({ \ #define ALLOC( _pointer_, _size_ ) ({ \
void *_tmp_; \ int result; \
FT_ALLOC( _tmp_, _size_ ); \ void *_tmp_; \
_pointer_ = _tmp_; \ result = FT_ALLOC( _tmp_, _size_ ); \
_pointer_ = _tmp_; \
result; \
}) })
#else #else
#define ALLOC_ARRAY( _pointer_, _count_, _type_ ) \ #define ALLOC_ARRAY( _pointer_, _count_, _type_ ) \