@@ -235,7 +235,7 @@ typedef ULONG RLONG; /* Used in reken.c. */
235235typedef int64_t MLONG; /* See commentary in minos.h. */
236236/*
237237 * NOTE: we don't use the standard _Bool (or C++ bool) because its size is
238- * implementation-dependent and messes up the traditional PADXXX macros .
238+ * implementation-dependent.
239239 */
240240typedef char BOOL;
241241 /* E.g. in 32-bits */
@@ -279,79 +279,6 @@ template<typename T> struct calc {
279279#endif
280280#endif
281281
282- /*
283- * Macros to be inserted at the end of a structure to align the whole structure.
284- *
285- * In the currently available systems,
286- * sizeof(POSITION) >= sizeof(pointers) == sizeof(LONG) >= sizeof(int)
287- * >= sizeof(WORD) >= sizeof(UBYTE) = 1.
288- * (POSITION is defined in struct.h and contains only an off_t variable.)
289- * Thus, if we put members of a structure in this order and use those macros,
290- * then we can align the data without relying on extra paddings added by
291- * the compiler. For example,
292- * typedef struct {
293- * int *a;
294- * LONG b;
295- * WORD c[2];
296- * UBYTE d;
297- * PADPOINTER(1,0,2,1);
298- * } A;
299- * typedef struct {
300- * POSITION p;
301- * A a; // aligned same as pointers
302- * int *b;
303- * LONG c;
304- * UBYTE d;
305- * PADPOSITION(1,1,0,0,1+sizeof(A));
306- * } B;
307- * The cost for the use of those PADXXX macros is a padding (>= 1 byte) will
308- * be always inserted even in the case that no padding is actually needed.
309- *
310- * Numbers for the arguments have to be calculated manually and so very
311- * error-prone. Be careful!
312- *
313- * Note that there is a 32-bit system in which off_t is aligned on 8-byte
314- * boundary, (e.g., Cygwin with large file support), but still the above
315- * inequalities are satisfied.
316- *
317- * The legendary story of these macros--they fixed some problems in ancient
318- * times when compilers were unreliable and didn't know how to correctly compute
319- * structure paddings--has been handed down, though nowadays there are only
320- * disadvantages for them in practice (ancient compilers most likely can't
321- * compile C99 and C++98+TR1 sources anyway).
322- */
323- #define PADDUMMY (type, size ) \
324- UBYTE d_u_m_m_y[form_alignof(type) - ((size) & (form_alignof(type) - 1 ))]
325- #define PADPOSITION (ptr_,long_,int_,word_,byte_ ) \
326- PADDUMMY (off_t , \
327- + sizeof (int *) * (ptr_) \
328- + sizeof(LONG) * (long_) \
329- + sizeof(int ) * (int_) \
330- + sizeof(WORD) * (word_) \
331- + sizeof(UBYTE) * (byte_) \
332- )
333- #define PADPOINTER (long_,int_,word_,byte_ ) \
334- PADDUMMY (int *, \
335- + sizeof (LONG) * (long_) \
336- + sizeof(int ) * (int_) \
337- + sizeof(WORD) * (word_) \
338- + sizeof(UBYTE) * (byte_) \
339- )
340- #define PADLONG (int_,word_,byte_ ) \
341- PADDUMMY (LONG, \
342- + sizeof (int ) * (int_) \
343- + sizeof(WORD) * (word_) \
344- + sizeof(UBYTE) * (byte_) \
345- )
346- #define PADINT (word_,byte_ ) \
347- PADDUMMY (int , \
348- + sizeof (WORD) * (word_) \
349- + sizeof(UBYTE) * (byte_) \
350- )
351- #define PADWORD (byte_ ) \
352- PADDUMMY (WORD, \
353- + sizeof (UBYTE) * (byte_) \
354- )
355282
356283/*
357284#define WITHPCOUNTER
0 commit comments