Align: Make sure 1 is treated as unsigned long instead of int
[coreboot.git] / src / include / stdlib.h
index 8742fdfe85a06b175e7339978c705e8517225e20..5465c14f925be86ecd16fbcb0499d704b3674749 100644 (file)
@@ -5,13 +5,13 @@
 
 #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
 
-#define ALIGN(x,a)              __ALIGN_MASK(x,(typeof(x))(a)-1)
+#define ALIGN(x,a)              __ALIGN_MASK(x,(typeof(x))(a)-1UL)
 #define __ALIGN_MASK(x,mask)    (((x)+(mask))&~(mask))
 
 #define MIN(a,b) ((a) < (b) ? (a) : (b))
 #define MAX(a,b) ((a) > (b) ? (a) : (b))
 
-#if !defined( __ROMCC__ ) && !defined(__PRE_RAM__)
+#if !defined(__PRE_RAM__)
 void *malloc(size_t size);
 void free(void *ptr);
 #endif