|
7 | 7 | *
|
8 | 8 | * Copyright (c) 1994, Regents of the University of California
|
9 | 9 | *
|
10 |
| - * $Id: c.h,v 1.31 1998/02/11 21:17:44 momjian Exp $ |
| 10 | + * $Id: c.h,v 1.32 1998/02/11 21:38:08 momjian Exp $ |
11 | 11 | *
|
12 | 12 | *-------------------------------------------------------------------------
|
13 | 13 | */
|
@@ -705,11 +705,16 @@ typedef struct Exception
|
705 | 705 | #defineStrNCpy(dst,src,len)\
|
706 | 706 | (strncpy((dst),(src),(len)),(len > 0) ? *((dst)+(len)-1)='\0' : (dummyret)NULL,(void)(dst))
|
707 | 707 |
|
| 708 | +/* Get a bit mask of the bits set in non-int32 aligned addresses */ |
| 709 | +#defineINT_ALIGN_MASK (sizeof(int32) - 1) |
| 710 | + |
708 | 711 | /* This function gets call too often, so we inline it if we can */
|
709 | 712 | #defineMemSet(start,val,len) do \
|
710 | 713 | {/* are we aligned for int32? */ \
|
711 |
| -if ((start)==INTALIGN(start)&& \ |
712 |
| -(len) %sizeof(int32)==0&& \ |
| 714 | +/* We have to cast the pointer to int \ |
| 715 | + so we can do the AND */ \ |
| 716 | +if (((long)(start)&INT_ALIGN_MASK)==0&& \ |
| 717 | +((len)&INT_ALIGN_MASK)==0&& \ |
713 | 718 | (val)==0&& \
|
714 | 719 | /* \
|
715 | 720 | * We got this number by testing this \
|
|