]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/blobdiff - include/linux/syscalls.h
teach SYSCALL_DEFINE<n> how to deal with long long/unsigned long long
[mirror_ubuntu-hirsute-kernel.git] / include / linux / syscalls.h
index f9411f0c1c802bf709db6ba951ba7864acbd5769..3e07b92efbf66972becd205a52cc1d25412c03fe 100644 (file)
@@ -96,9 +96,10 @@ struct sigaltstack;
 #define __MAP(n,...) __MAP##n(__VA_ARGS__)
 
 #define __SC_DECL(t, a)        t a
-#define __SC_LONG(t, a)        long a
+#define __TYPE_IS_LL(t) (__same_type((t)0, 0LL) || __same_type((t)0, 0ULL))
+#define __SC_LONG(t, a) __typeof(__builtin_choose_expr(__TYPE_IS_LL(t), 0LL, 0L)) a
 #define __SC_CAST(t, a)        (t) a
-#define __SC_TEST(t, a) (void)BUILD_BUG_ON_ZERO(sizeof(type) > sizeof(long))
+#define __SC_TEST(t, a) (void)BUILD_BUG_ON_ZERO(!__TYPE_IS_LL(t) && sizeof(t) > sizeof(long))
 
 #ifdef CONFIG_FTRACE_SYSCALLS
 #define __SC_STR_ADECL(t, a)   #a