Portability fixes for HP-UX (reported by Christoph Bauer). Replace

'__inline__' by AC_C_INLINE and 'inline'. Replace '__alignof__' by
    'fc_alignof'.
reviewed by: plam
This commit is contained in:
Patrick Lam 2006-04-07 17:27:39 +00:00
parent 91fe51b4f8
commit 44415a079a
8 changed files with 33 additions and 14 deletions

View File

@ -1,3 +1,18 @@
2006-04-07 Dominic Lachowicz <cinamod@hotmail.com>
reviewed by: plam
* configure.in:
* src/fccharset.c (FcCharSetNeededBytes):
* src/fcfs.c (FcFontSetNeededBytes):
* src/fcint.h:
* src/fclang.c (FcLangSetNeededBytesAlign):
* src/fcname.c (FcObjectNeededBytesAlign):
* src/fcpat.c (FcPatternNeededBytesAlign,
FcValueListNeededBytesAlign, FcStrNeededBytesAlign):
Portability fixes for HP-UX (reported by Christoph Bauer).
Replace '__inline__' by AC_C_INLINE and 'inline'.
Replace '__alignof__' by 'fc_alignof'.
2006-04-07 Dominic Lachowicz <cinamod@hotmail.com> 2006-04-07 Dominic Lachowicz <cinamod@hotmail.com>
reviewed by: plam reviewed by: plam
* src/fcint.h: * src/fcint.h:

View File

@ -139,6 +139,7 @@ AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h iconv.h])
# Checks for typedefs, structures, and compiler characteristics. # Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST AC_C_CONST
AC_C_INLINE
AC_TYPE_PID_T AC_TYPE_PID_T
# Checks for library functions. # Checks for library functions.

View File

@ -1335,8 +1335,8 @@ FcCharSetNeededBytes (const FcCharSet *c)
int int
FcCharSetNeededBytesAlign (void) FcCharSetNeededBytesAlign (void)
{ {
return __alignof__ (FcCharSet) + __alignof__ (int) + return fc_alignof (FcCharSet) + fc_alignof (int) +
__alignof__ (FcCharLeaf) + __alignof__ (FcChar16); fc_alignof (FcCharLeaf) + fc_alignof (FcChar16);
} }
static FcBool static FcBool

View File

@ -113,7 +113,7 @@ FcFontSetNeededBytes (FcFontSet *s)
int int
FcFontSetNeededBytesAlign (void) FcFontSetNeededBytesAlign (void)
{ {
return __alignof__(int) + return fc_alignof (int) +
FcPatternNeededBytesAlign () + FcObjectNeededBytesAlign (); FcPatternNeededBytesAlign () + FcObjectNeededBytesAlign ();
} }

View File

@ -321,6 +321,8 @@ typedef struct _FcCaseFold {
#define fc_value_langset(v) (((v)->type & FC_STORAGE_STATIC) ? (const FcLangSet *)(((char *) v) + (v)->u.l_off) : (v) -> u.l) #define fc_value_langset(v) (((v)->type & FC_STORAGE_STATIC) ? (const FcLangSet *)(((char *) v) + (v)->u.l_off) : (v) -> u.l)
#define fc_storage_type(v) ((v)->type & ~FC_STORAGE_STATIC) #define fc_storage_type(v) ((v)->type & ~FC_STORAGE_STATIC)
#define fc_alignof(type) offsetof (struct { char c; type member; }, member)
/* /*
* The per-user ~/.fonts.cache-<version> file is loaded into * The per-user ~/.fonts.cache-<version> file is loaded into
* this data structure. Each directory gets a substructure * this data structure. Each directory gets a substructure
@ -432,7 +434,8 @@ typedef struct _FcFileTime {
typedef struct _FcCharMap FcCharMap; typedef struct _FcCharMap FcCharMap;
#define ALIGN(v,type) ((__typeof__(v))(((uintptr_t)(v) + __alignof__(type) - 1) & ~(__alignof__(type) - 1))) /* watch out; assumes that v is void * -PL */
#define ALIGN(v,type) ((void *)(((uintptr_t)(v) + fc_alignof(type) - 1) & ~(fc_alignof(type) - 1)))
/* fcblanks.c */ /* fcblanks.c */
@ -482,7 +485,7 @@ extern int *_fcBankId, *_fcBankIdx;
int int
FcCacheBankToIndexMTF (int bank); FcCacheBankToIndexMTF (int bank);
static __inline__ int static inline int
FcCacheBankToIndex (int bank) FcCacheBankToIndex (int bank)
{ {
return (_fcBankId[*_fcBankIdx] == bank) ? *_fcBankIdx : FcCacheBankToIndexMTF(bank); return (_fcBankId[*_fcBankIdx] == bank) ? *_fcBankIdx : FcCacheBankToIndexMTF(bank);
@ -622,7 +625,7 @@ FcSubstPrint (const FcSubst *subst);
extern int FcDebugVal; extern int FcDebugVal;
static __inline__ int static inline int
FcDebug (void) { return FcDebugVal; } FcDebug (void) { return FcDebugVal; }
void void
@ -829,7 +832,7 @@ FcObjectSerialize (void);
const char * const char *
FcObjectPtrU (FcObjectPtr p); FcObjectPtrU (FcObjectPtr p);
static __inline__ int static inline int
FcObjectPtrCompare (const FcObjectPtr a, const FcObjectPtr b) FcObjectPtrCompare (const FcObjectPtr a, const FcObjectPtr b)
{ {
return a - b; return a - b;
@ -897,7 +900,7 @@ FcPatternDistributeBytes (FcCache * metadata, void * block_ptr);
extern FcValueList ** _fcValueLists; extern FcValueList ** _fcValueLists;
extern FcPatternElt ** _fcPatternElts; extern FcPatternElt ** _fcPatternElts;
static __inline__ FcValueList * static inline FcValueList *
FcValueListPtrU (FcValueListPtr pi) FcValueListPtrU (FcValueListPtr pi)
{ {
if (pi.bank == FC_BANK_DYNAMIC) if (pi.bank == FC_BANK_DYNAMIC)
@ -906,7 +909,7 @@ FcValueListPtrU (FcValueListPtr pi)
return &_fcValueLists[FcCacheBankToIndex(pi.bank)][pi.u.stat]; return &_fcValueLists[FcCacheBankToIndex(pi.bank)][pi.u.stat];
} }
static __inline__ FcPatternElt * static inline FcPatternElt *
FcPatternEltU (FcPatternEltPtr pei) FcPatternEltU (FcPatternEltPtr pei)
{ {
if (pei.bank == FC_BANK_DYNAMIC) if (pei.bank == FC_BANK_DYNAMIC)

View File

@ -723,7 +723,7 @@ FcLangSetNeededBytes (const FcLangSet *l)
int int
FcLangSetNeededBytesAlign (void) FcLangSetNeededBytesAlign (void)
{ {
return __alignof__ (FcLangSet); return fc_alignof (FcLangSet);
} }
static FcBool static FcBool

View File

@ -342,7 +342,7 @@ FcObjectNeededBytes ()
int int
FcObjectNeededBytesAlign (void) FcObjectNeededBytesAlign (void)
{ {
return __alignof__ (int) + __alignof__ (char); return fc_alignof (int) + fc_alignof (char);
} }
void * void *

View File

@ -1531,7 +1531,7 @@ FcPatternNeededBytes (FcPattern * p)
int int
FcPatternNeededBytesAlign (void) FcPatternNeededBytesAlign (void)
{ {
return __alignof__ (FcPattern) + __alignof__ (FcPatternElt) + return fc_alignof (FcPattern) + fc_alignof (FcPatternElt) +
FcValueListNeededBytesAlign (); FcValueListNeededBytesAlign ();
} }
@ -1725,7 +1725,7 @@ static int
FcValueListNeededBytesAlign (void) FcValueListNeededBytesAlign (void)
{ {
return FcCharSetNeededBytesAlign() + FcLangSetNeededBytesAlign() + return FcCharSetNeededBytesAlign() + FcLangSetNeededBytesAlign() +
FcStrNeededBytesAlign() + __alignof__ (FcValueList); FcStrNeededBytesAlign() + fc_alignof (FcValueList);
} }
static FcBool static FcBool
@ -1928,7 +1928,7 @@ FcStrNeededBytes (const FcChar8 * s)
static int static int
FcStrNeededBytesAlign (void) FcStrNeededBytesAlign (void)
{ {
return __alignof__ (char); return fc_alignof (char);
} }
static FcBool static FcBool