]> git.saurik.com Git - apple/libc.git/blob - nls/FreeBSD/msgcat.h.patch
Libc-763.11.tar.gz
[apple/libc.git] / nls / FreeBSD / msgcat.h.patch
1 --- msgcat.h.orig 2009-11-23 18:16:18.000000000 -0800
2 +++ msgcat.h 2009-12-05 13:58:11.000000000 -0800
3 @@ -43,13 +43,14 @@ up-to-date. Many thanks.
4 #define MCMagicLen 8
5 #define MCMagic "*nazgul*"
6
7 -#define MCMajorVer 1L
8 +#define MCMajorVer 1
9 #define MCMinorVer 0
10
11 /* For or'd constants */
12 -#define MCMakeId(s,m) (unsigned long) ( ((unsigned short)s << (sizeof(short)*8)) \
13 +#define MCMakeId(s,m) (u_int32_t) ( ((unsigned short)s << (sizeof(short)*8)) \
14 | (unsigned short)m )
15
16 +
17 /*
18 * Critical note here. Sets and Messages *MUST* be stored in ascending
19 * order. There are stored that way (by specification) in the original
20 @@ -88,37 +89,43 @@ typedef union {
21 struct _MCSetT *set;
22 } MCOffsetT;
23
24 +#ifdef __LP64__
25 +#pragma pack(4)
26 +#endif /* __LP64__ */
27 /*
28 * MCMsgT - Message structure (disk and runtime)
29 */
30 typedef struct _MCMsgT {
31 - long msgId; /* Id of this message */
32 + int32_t msgId; /* Id of this message */
33 MCOffsetT msg; /* Relative offset on disk or pointer in memory */
34 - long invalid; /* Valid on disk, loaded in memory */
35 + int32_t invalid; /* Valid on disk, loaded in memory */
36 } MCMsgT;
37
38 /*
39 * MCSetT - Set structure (disk and runtime)
40 */
41 typedef struct _MCSetT {
42 - long setId; /* Id of this set */
43 + int32_t setId; /* Id of this set */
44 off_t nextSet; /* Offset of next set on disk */
45 union {
46 off_t firstMsg; /* Offset to first Msg (while on disk) */
47 MCMsgT *msgs; /* Pointer to array of msgs (in mem, loaded) */
48 } u;
49 MCOffsetT data; /* Offset to data, or pointer to data */
50 - long dataLen; /* Length of data area on disk */
51 - long numMsgs; /* Number of messages */
52 - long invalid; /* Valid on disk, loaded in memory */
53 + int32_t dataLen; /* Length of data area on disk */
54 + int32_t numMsgs; /* Number of messages */
55 + int32_t invalid; /* Valid on disk, loaded in memory */
56 } MCSetT;
57 +#ifdef __LP64__
58 +#pragma pack()
59 +#endif /* __LP64__ */
60
61 /*
62 * MCCatT - Runtime catalog pointer
63 */
64 typedef struct {
65 FILE *fp; /* File descriptor of catalog (if load-on-demand) */
66 - long numSets; /* Number of sets */
67 + int32_t numSets; /* Number of sets */
68 MCSetT *sets; /* Pointer to the sets */
69 off_t firstSet; /* Offset of first set on disk */
70 } MCCatT;
71 @@ -128,10 +135,10 @@ typedef struct {
72 */
73 typedef struct {
74 char magic[MCMagicLen]; /* Magic cookie "*nazgul*" */
75 - long majorVer; /* ++ on incompatible changes */
76 - long minorVer; /* ++ on compatible changes */
77 - long flags; /* Informational flags */
78 - long numSets; /* Number of valid Sets */
79 + int32_t majorVer; /* ++ on incompatible changes */
80 + int32_t minorVer; /* ++ on compatible changes */
81 + int32_t flags; /* Informational flags */
82 + int32_t numSets; /* Number of valid Sets */
83 off_t firstSet; /* Offset of first set on disk */
84 } MCHeaderT;
85