lkml.org 
[lkml]   [2018]   [Apr]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 42/45] C++: Hide C++ keywords
From
Date
Hide C++ keywords like new, delete, class and private.

Signed-off-by: David Howells <dhowells@redhat.com>
---

include/linux/page-flags.h | 3 +++
include/linux/types.h | 6 ++++++
2 files changed, 9 insertions(+)

diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 50c2b8786831..6705394b8f69 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -131,6 +131,9 @@ enum pageflags {

/* non-lru isolated movable page */
PG_isolated = PG_reclaim,
+
+ /* C++-ism */
+ PG__Private = PG_private,
};

#ifndef __GENERATING_BOUNDS_H
diff --git a/include/linux/types.h b/include/linux/types.h
index d233b12c7ebe..1554319a3ff2 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -11,6 +11,12 @@

#ifndef __ASSEMBLY__

+#define class _Class
+#define new _New
+#define delete _Delete
+#define namespace _Namespace
+#define private _Private
+
#define DECLARE_BITMAP(name,bits) \
unsigned long name[BITS_TO_LONGS(bits)]

\
 
 \ /
  Last update: 2018-04-01 22:45    [W:0.977 / U:0.996 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site