]> git.wh0rd.org - fontconfig.git/commitdiff
Portability fixes for HP-UX (reported by Christoph Bauer). Replace
authorPatrick Lam <plam@MIT.EDU>
Fri, 7 Apr 2006 17:27:39 +0000 (17:27 +0000)
committerPatrick Lam <plam@MIT.EDU>
Fri, 7 Apr 2006 17:27:39 +0000 (17:27 +0000)
    '__inline__' by AC_C_INLINE and 'inline'. Replace '__alignof__' by
    'fc_alignof'.
reviewed by: plam

ChangeLog
configure.in
src/fccharset.c
src/fcfs.c
src/fcint.h
src/fclang.c
src/fcname.c
src/fcpat.c

index d2e879df0abc61b9198ad1fb021dad2def78c54a..560be03c16ff1d9ed40e845e0a6ffc1444723003 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
        reviewed by: plam
        * src/fcint.h:
index 4ec7abd121986d7d21897a8351331c42e5bf315b..cfaf102395a7eff5b1daf2a36e99f34a8c2c020c 100644 (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.
 AC_C_CONST
+AC_C_INLINE
 AC_TYPE_PID_T
 
 # Checks for library functions.
index 460789221e6b9d6f87aa40a473874584c5170166..d1a9d6ec6ad55bf1f963782abab25cdfcac1956c 100644 (file)
@@ -1335,8 +1335,8 @@ FcCharSetNeededBytes (const FcCharSet *c)
 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
index bb7ff39a354a3cbb28c86b6d93db105cdb6dd268..a9599ee3ca61afcb55214caf27966f730d0bc0c0 100644 (file)
@@ -113,7 +113,7 @@ FcFontSetNeededBytes (FcFontSet *s)
 int
 FcFontSetNeededBytesAlign (void)
 {
-    return __alignof__(int) + 
+    return fc_alignof (int) + 
        FcPatternNeededBytesAlign () + FcObjectNeededBytesAlign ();
 }
 
index 0a036b4f864a9f52fd3abb3d9966ba1605e26d08..92e048eb15ab3636ad3cb806c521c01ea0bc100b 100644 (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_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
@@ -432,7 +434,8 @@ typedef struct _FcFileTime {
 
 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 */
 
@@ -482,7 +485,7 @@ extern int *_fcBankId, *_fcBankIdx;
 int
 FcCacheBankToIndexMTF (int bank);
 
-static __inline__ int
+static inline int
 FcCacheBankToIndex (int bank)
 {
     return (_fcBankId[*_fcBankIdx] == bank) ? *_fcBankIdx : FcCacheBankToIndexMTF(bank);
@@ -622,7 +625,7 @@ FcSubstPrint (const FcSubst *subst);
 
 extern int FcDebugVal;
 
-static __inline__ int
+static inline int
 FcDebug (void) { return FcDebugVal; }
 
 void
@@ -829,7 +832,7 @@ FcObjectSerialize (void);
 const char *
 FcObjectPtrU (FcObjectPtr p);
 
-static __inline__ int
+static inline int
 FcObjectPtrCompare (const FcObjectPtr a, const FcObjectPtr b)
 {
     return a - b;
@@ -897,7 +900,7 @@ FcPatternDistributeBytes (FcCache * metadata, void * block_ptr);
 extern FcValueList ** _fcValueLists;
 extern FcPatternElt ** _fcPatternElts;
 
-static __inline__ FcValueList * 
+static inline FcValueList * 
 FcValueListPtrU (FcValueListPtr pi)
 {
     if (pi.bank == FC_BANK_DYNAMIC)
@@ -906,7 +909,7 @@ FcValueListPtrU (FcValueListPtr pi)
     return &_fcValueLists[FcCacheBankToIndex(pi.bank)][pi.u.stat];
 }
 
-static __inline__ FcPatternElt *
+static inline FcPatternElt *
 FcPatternEltU (FcPatternEltPtr pei)
 {
     if (pei.bank == FC_BANK_DYNAMIC)
index e33afd26aff0a644417802952fea61b7629d0f95..7af6ed190498a1d5ee2a14bfb749b40f05799228 100644 (file)
@@ -723,7 +723,7 @@ FcLangSetNeededBytes (const FcLangSet *l)
 int
 FcLangSetNeededBytesAlign (void)
 {
-    return __alignof__ (FcLangSet);
+    return fc_alignof (FcLangSet);
 }
 
 static FcBool
index c6c187adef58aaecd1a5b9dd249744c0dee5471b..bc55d2cb9851d7ff2cab3da5efcbb6a9305435aa 100644 (file)
@@ -342,7 +342,7 @@ FcObjectNeededBytes ()
 int
 FcObjectNeededBytesAlign (void)
 {
-    return __alignof__ (int) + __alignof__ (char);
+    return fc_alignof (int) + fc_alignof (char);
 }
 
 void *
index 4162872fcbdd2b314be178157215168ad45af52f..ba88ebf93360d9bad33294cd14628146ed1b3edf 100644 (file)
@@ -1531,7 +1531,7 @@ FcPatternNeededBytes (FcPattern * p)
 int
 FcPatternNeededBytesAlign (void)
 {
-    return __alignof__ (FcPattern) + __alignof__ (FcPatternElt) + 
+    return fc_alignof (FcPattern) + fc_alignof (FcPatternElt) + 
        FcValueListNeededBytesAlign ();
 }
 
@@ -1725,7 +1725,7 @@ static int
 FcValueListNeededBytesAlign (void)
 {
     return FcCharSetNeededBytesAlign() + FcLangSetNeededBytesAlign() + 
-       FcStrNeededBytesAlign() + __alignof__ (FcValueList);
+       FcStrNeededBytesAlign() + fc_alignof (FcValueList);
 }
 
 static FcBool
@@ -1928,7 +1928,7 @@ FcStrNeededBytes (const FcChar8 * s)
 static int
 FcStrNeededBytesAlign (void)
 {
-    return __alignof__ (char);
+    return fc_alignof (char);
 }
 
 static FcBool