+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>
reviewed by: plam
* src/fcint.h:
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
+AC_C_INLINE
AC_TYPE_PID_T
# Checks for library functions.
int
FcCharSetNeededBytesAlign (void)
{
- return __alignof__ (FcCharSet) + __alignof__ (int) +
- __alignof__ (FcCharLeaf) + __alignof__ (FcChar16);
+ return fc_alignof (FcCharSet) + fc_alignof (int) +
+ fc_alignof (FcCharLeaf) + fc_alignof (FcChar16);
}
static FcBool
int
FcFontSetNeededBytesAlign (void)
{
- return __alignof__(int) +
+ return fc_alignof (int) +
FcPatternNeededBytesAlign () + FcObjectNeededBytesAlign ();
}
#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_alignof(type) offsetof (struct { char c; type member; }, member)
+
/*
* The per-user ~/.fonts.cache-<version> file is loaded into
* this data structure. Each directory gets a substructure
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 */
int
FcCacheBankToIndexMTF (int bank);
-static __inline__ int
+static inline int
FcCacheBankToIndex (int bank)
{
return (_fcBankId[*_fcBankIdx] == bank) ? *_fcBankIdx : FcCacheBankToIndexMTF(bank);
extern int FcDebugVal;
-static __inline__ int
+static inline int
FcDebug (void) { return FcDebugVal; }
void
const char *
FcObjectPtrU (FcObjectPtr p);
-static __inline__ int
+static inline int
FcObjectPtrCompare (const FcObjectPtr a, const FcObjectPtr b)
{
return a - b;
extern FcValueList ** _fcValueLists;
extern FcPatternElt ** _fcPatternElts;
-static __inline__ FcValueList *
+static inline FcValueList *
FcValueListPtrU (FcValueListPtr pi)
{
if (pi.bank == FC_BANK_DYNAMIC)
return &_fcValueLists[FcCacheBankToIndex(pi.bank)][pi.u.stat];
}
-static __inline__ FcPatternElt *
+static inline FcPatternElt *
FcPatternEltU (FcPatternEltPtr pei)
{
if (pei.bank == FC_BANK_DYNAMIC)
int
FcLangSetNeededBytesAlign (void)
{
- return __alignof__ (FcLangSet);
+ return fc_alignof (FcLangSet);
}
static FcBool
int
FcObjectNeededBytesAlign (void)
{
- return __alignof__ (int) + __alignof__ (char);
+ return fc_alignof (int) + fc_alignof (char);
}
void *
int
FcPatternNeededBytesAlign (void)
{
- return __alignof__ (FcPattern) + __alignof__ (FcPatternElt) +
+ return fc_alignof (FcPattern) + fc_alignof (FcPatternElt) +
FcValueListNeededBytesAlign ();
}
FcValueListNeededBytesAlign (void)
{
return FcCharSetNeededBytesAlign() + FcLangSetNeededBytesAlign() +
- FcStrNeededBytesAlign() + __alignof__ (FcValueList);
+ FcStrNeededBytesAlign() + fc_alignof (FcValueList);
}
static FcBool
static int
FcStrNeededBytesAlign (void)
{
- return __alignof__ (char);
+ return fc_alignof (char);
}
static FcBool