lkml.org 
[lkml]   [2015]   [May]   [30]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 86/98] include/uapi/linux/btrfs.h: define NULL
Date
Copied the NULL definition from include/linux/stddef.h which does not have
it in userspace.

Fixes userspace compilation error:

error: ‘NULL’ undeclared (first use in this function)
return NULL;

Signed-off-by: Mikko Rapeli <mikko.rapeli@iki.fi>
---
include/uapi/linux/btrfs.h | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/include/uapi/linux/btrfs.h b/include/uapi/linux/btrfs.h
index b6dec05..a8ae69b 100644
--- a/include/uapi/linux/btrfs.h
+++ b/include/uapi/linux/btrfs.h
@@ -20,6 +20,12 @@
#define _UAPI_LINUX_BTRFS_H
#include <linux/types.h>
#include <linux/ioctl.h>
+#include <linux/stddef.h>
+
+/* for userspace where linux/stddef.h doesn't define this */
+#ifndef NULL
+#define NULL ((void *)0)
+#endif

#define BTRFS_IOCTL_MAGIC 0x94
#define BTRFS_VOL_NAME_MAX 255
--
2.1.4


\
 
 \ /
  Last update: 2015-05-30 19:01    [W:0.334 / U:1.296 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site