]> git.wh0rd.org - fontconfig.git/blobdiff - src/fcint.h
Bump cache version up from 2 to 3 and fix FcLangSet caching/crash
[fontconfig.git] / src / fcint.h
index 4414a2d842ae02673278124984810e4ee904a8e7..437115894cfdd17d6fdb1c64ecfa6013e93b615c 100644 (file)
 #define FC_BANK_FIRST 1
 #define FC_BANK_LANGS      0xfcfcfcfc
 
+#define FC_MIN(a,b) ((a) < (b) ? (a) : (b))
+#define FC_MAX(a,b) ((a) > (b) ? (a) : (b))
+#define FC_ABS(a)   ((a) < 0 ? -(a) : (a))
+
 /* slim_internal.h */
 #if (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) && defined(__ELF__) && !defined(__sun)
 #define FcPrivate              __attribute__((__visibility__("hidden")))
@@ -351,6 +355,14 @@ struct _FcCache {
 
 #define FC_SERIALIZE_HASH_SIZE 8191
 
+typedef union _FcAlign {
+    double     d;
+    int                i;
+    intptr_t   ip;
+    FcBool     b;
+    void       *p;
+} FcAlign;
+
 typedef struct _FcSerializeBucket {
     struct _FcSerializeBucket *next;
     const void *object;
@@ -420,7 +432,7 @@ typedef struct _FcCaseFold {
 
 #define FC_CACHE_MAGIC_MMAP        0xFC02FC04
 #define FC_CACHE_MAGIC_ALLOC       0xFC02FC05
-#define FC_CACHE_CONTENT_VERSION    2
+#define FC_CACHE_CONTENT_VERSION    3 /* also check FC_CACHE_VERSION */
 
 struct _FcAtomic {
     FcChar8    *file;          /* original file name */
@@ -538,7 +550,7 @@ FcDirCacheReference (FcCache *cache, int nref);
 
 #ifdef _WIN32
 FcPrivate int
-FcStat (const char *file, struct stat *statb)
+FcStat (const char *file, struct stat *statb);
 #else
 #define FcStat stat
 #endif