Thread (9 messages) flat view 9 messages, 4 authors, 2017-01-08

[PATCH v2 2/4] linux/const.h: move UL() macro to include/linux/const.h

From: dhowells@redhat.com (David Howells)
Date: 2017-01-06 10:47:35
Also in: lkml

Masahiro Yamada [off-list ref] wrote:
quoted hunk ↗ jump to hunk
diff --git a/include/uapi/linux/const.h b/include/uapi/linux/const.h
index c872bfd..76fb0f9 100644
--- a/include/uapi/linux/const.h
+++ b/include/uapi/linux/const.h
@@ -1,7 +1,7 @@
 /* const.h: Macros for dealing with constants.  */
 
-#ifndef _LINUX_CONST_H
-#define _LINUX_CONST_H
+#ifndef _UAPI_LINUX_CONST_H
+#define _UAPI_LINUX_CONST_H
You need to be very careful doing this.  Some userspace stuff depends on the
guard macro names on the kernel header files.
quoted hunk ↗ jump to hunk
 /* Some constant macros are used in both assembler and
  * C code.  Therefore we cannot annotate them always with
@@ -21,7 +21,10 @@
 #define _AT(T,X)	((T)(X))
 #endif
 
+#define _UL(x)		(_AC(x, UL))
+#define _ULL(x)		(_AC(x, ULL))
How likely is this to collide with existing userspace code somewhere?  It
looks like the sort of thing that could collide with a C library.

David
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help