Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 471020 | Differences between
and this patch

Collapse All | Expand All

(-)a/include/libc-internal.h (-1 / +20 lines)
Lines 50-53 extern void __init_misc (int, char **, char **); Link Here
50
/* Cast an integer or a pointer VAL to integer with proper type.  */
50
/* Cast an integer or a pointer VAL to integer with proper type.  */
51
# define cast_to_integer(val) ((__integer_if_pointer_type (val)) (val))
51
# define cast_to_integer(val) ((__integer_if_pointer_type (val)) (val))
52
52
53
/* Align a value by rounding down to closest size.
54
   e.g. Using size of 4096, we get this behavior:
55
	{4095, 4096, 4097} = {0, 4096, 4096}.  */
56
#define ALIGN_DOWN(base, size)	((base) & -((__typeof__ (base)) (size)))
57
58
/* Align a value by rounding up to closest size.
59
   e.g. Using size of 4096, we get this behavior:
60
	{4095, 4096, 4097} = {4096, 4096, 8192}.
61
62
  Note: The size argument has side effects (expanded multiple times).  */
63
#define ALIGN_UP(base, size)	ALIGN_DOWN ((base) + (size) - 1, (size))
64
65
/* Same as ALIGN_DOWN(), but automatically casts when base is a pointer.  */
66
#define PTR_ALIGN_DOWN(base, size) \
67
  ((__typeof__ (base)) ALIGN_DOWN ((uintptr_t) (base), (size)))
68
69
/* Same as ALIGN_UP(), but automatically casts when base is a pointer.  */
70
#define PTR_ALIGN_UP(base, size) \
71
  ((__typeof__ (base)) ALIGN_UP ((uintptr_t) (base), (size)))
72
53
#endif /* _LIBC_INTERNAL  */
73
#endif /* _LIBC_INTERNAL  */
54
- 

Return to bug 471020