Ignore:
Timestamp:
Apr 25, 2007, 9:44:55 AM (14 years ago)
Author:
Paul Smedley
Message:

Code updated to Samba 3.0.25rc2 level

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/samba/source/include/smb_macros.h

    r1 r30  
    4747#endif
    4848
    49 /* zero a structure */
    50 #define ZERO_STRUCT(x) memset((char *)&(x), 0, sizeof(x))
    51 
    52 /* zero a structure given a pointer to the structure */
    53 #define ZERO_STRUCTP(x) do { if ((x) != NULL) memset((char *)(x), 0, sizeof(*(x))); } while(0)
    54 
    55 /* zero a structure given a pointer to the structure - no zero check */
    56 #define ZERO_STRUCTPN(x) memset((char *)(x), 0, sizeof(*(x)))
    57 
    58 /* zero an array - note that sizeof(array) must work - ie. it must not be a
    59    pointer */
    60 #define ZERO_ARRAY(x) memset((char *)(x), 0, sizeof(x))
    61 
    62 /* pointer difference macro */
    63 #define PTR_DIFF(p1,p2) ((ptrdiff_t)(((const char *)(p1)) - (const char *)(p2)))
    64 
    65 /* work out how many elements there are in a static array */
    66 #define ARRAY_SIZE(a) (sizeof(a)/sizeof(a[0]))
    67 
    6849/* assert macros */
    6950#ifdef DEVELOPER
     
    351332#else
    352333
    353 #define _STRING_LINE_(s)    #s
    354 #define _STRING_LINE2_(s)   _STRING_LINE_(s)
    355 #define __LINESTR__       _STRING_LINE2_(__LINE__)
    356 #define __location__ __FILE__ ":" __LINESTR__
    357 
    358334#define PRS_ALLOC_MEM(ps, type, count) (type *)prs_alloc_mem((ps),sizeof(type),(count))
    359335#define PRS_ALLOC_MEM_VOID(ps, size) prs_alloc_mem((ps),(size),1)
Note: See TracChangeset for help on using the changeset viewer.