Changeset 2861 for trunk/kLdr/kLdrHlp.h


Ignore:
Timestamp:
Nov 10, 2006, 4:04:42 AM (19 years ago)
Author:
bird
Message:

Put the PE module interpreter thru the wringer and learnt how much the window file mapping API sucks.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kLdr/kLdrHlp.h

    r2858 r2861  
    3434
    3535/** Get the minimum of two values. */
    36 #define KLDR_MIN(a, b) ((a) <= (b) ? (a) : (b))
     36#define KLDR_MIN(a, b)              ((a) <= (b) ? (a) : (b))
    3737/** Get the maximum of two values. */
    38 #define KLDR_MAX(a, b) ((a) >= (b) ? (a) : (b))
     38#define KLDR_MAX(a, b)              ((a) >= (b) ? (a) : (b))
    3939/** Calculate the offset of a structure member. */
    4040#define KLDR_OFFSETOF(strct, memb)  ( (size_t)( &((strct *)0)->memb ) )
     
    4343/** Align a void * value. */
    4444#define KLDR_ALIGN_P(pv, align)     ( (void *)( ((uintptr_t)(pv) + ((align) - 1)) & ~(uintptr_t)((align) - 1) ) )
     45/** Number of elements in an array. */
     46#define KLDR_ELEMENTS(a)            ( sizeof(a) / sizeof((a)[0]) )
     47
    4548/** @def KLDRHLP_LE2H_U16
    4649 * Unsigned 16-bit little-endian to host translation. */
Note: See TracChangeset for help on using the changeset viewer.