[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Minios-devel] [UNIKRAFT PATCH 3/5] lib/nolibc: Introduce sys/cdefs.h header


  • To: minios-devel@xxxxxxxxxxxxx
  • From: Costin Lupu <costin.lupu@xxxxxxxxx>
  • Date: Tue, 3 Jul 2018 10:04:15 +0300
  • Cc: simon.kuenzer@xxxxxxxxx, sharan.santhanam@xxxxxxxxx, yuri.volchkov@xxxxxxxxx
  • Delivery-date: Tue, 03 Jul 2018 07:04:31 +0000
  • Ironport-phdr: 9a23:0c1hgxdfZKFbV3olwptd17qGlGMj4u6mDksu8pMizoh2WeGdxcW5Yh7h7PlgxGXEQZ/co6odzbaO7ea4ASQp2tWoiDg6aptCVhsI2409vjcLJ4q7M3D9N+PgdCcgHc5PBxdP9nC/NlVJSo6lPwWB6nK94iQPFRrhKAF7Ovr6GpLIj8Swyuu+54Dfbx9HiTahYL5+Ngm6oRnMvcQKnIVuLbo8xAHUqXVSYeRWwm1oJVOXnxni48q74YBu/SdNtf8/7sBMSar1cbg2QrxeFzQmLns65Nb3uhnZTAuA/WUTX2MLmRdVGQfF7RX6XpDssivms+d2xSeXMdHqQb0yRD+v6bpgRh31hycdLzM38H/ZhNF+gqxYpxyupRJ/zpXIbI2JLvdyYrnQcc8GSWdHQ81fVzZBAoS5b4YXEecBOv1Yr5X8p1sIsBCwAxSsBPvyyjRVgXL5wao60/89EQHH2gwsBdYOsGnMrNXoL6odTfu1wLPQzTXedPxawy396I/Rfx0nvPqCXqpwfNLMxUQgCg/JlFadpIz/Mz+LyOgAsXKX4uR4We6yhGMrtht9rzuvy8s2lIXEiIwYxkrZ+Sh23oo4I8CzRlRhbt6+CpRQsjmXN45xQsw/XW5loD06yrgauZ6jeygK1Ygnywbfa/OZd4iI5QruVPiUIThihXJlfKiziAqp8US60u38S9K73ExQripCitXMt3YN2ALP6sWfV/dw8Vqt1SyM2g3T8O1IP144mKjBJ5Mv2rIwk4AcsUXHHi/4gkX2i6qWe1049eiv8OTnfrTmppmGO49wlwH+Krkul9ejDuQjKAQOR3Wb9v+m2L35+k31WK9KgeEukqnFrJDaItwWpqu4Aw9T04Yj7A2/Ay6739sGg3kIMlZFdQmDj4joIFHOPOv4Ae2wgluyljdn3ffGPqfuAp/VNHjMjK/hfaph605b0Acz1tBf6IhOCr4bJvL/QFTxu8beDh8lMwy72eDnB8941o4FX2KAHLOWMKfIvlCT/O4gPfSMbpcPuDnhM/gl++LujXghlF8GfKmp2JwXaHaiEvRlPkWWf3zsg9YfHmcQpQc+SvLlh0GGUTFJfHm+Rbwz5iwjAoK8EYjDXpytgKCG3CqjHpxWe3pGClGWHXf2cIWEX+sDaCKRIs9mjDwJTr6hRJE92hGqrgD10KBrIfTJ+n5QiZW20dlz5urI0B0/6zFwJ8CcyH2WCXF5mCUPXTBl8rp4pBlWzUyf0K4wp+FACJQH7PRSTgY8c5rB1/FSAMu0Qh/LOM2OHgX1Cu66CC08G4pii+QFZFxwTo2v
  • List-id: Mini-os development list <minios-devel.lists.xenproject.org>

Signed-off-by: Costin Lupu <costin.lupu@xxxxxxxxx>
---
 lib/nolibc/include/ctype.h     |  2 ++
 lib/nolibc/include/sys/cdefs.h | 43 ++++++++++++++++++++++++++++++++++++++++++
 lib/nolibc/stdlib.c            |  2 --
 3 files changed, 45 insertions(+), 2 deletions(-)
 create mode 100644 lib/nolibc/include/sys/cdefs.h

diff --git a/lib/nolibc/include/ctype.h b/lib/nolibc/include/ctype.h
index c3bbeb6..61b37e2 100644
--- a/lib/nolibc/include/ctype.h
+++ b/lib/nolibc/include/ctype.h
@@ -27,6 +27,8 @@
 #ifndef __CTYPE_H__
 #define __CTYPE_H__
 
+#include <sys/cdefs.h>
+
 /*
  * NOTE! This ctype does not handle EOF like the standard C
  * library is required to.
diff --git a/lib/nolibc/include/sys/cdefs.h b/lib/nolibc/include/sys/cdefs.h
new file mode 100644
index 0000000..559654f
--- /dev/null
+++ b/lib/nolibc/include/sys/cdefs.h
@@ -0,0 +1,43 @@
+/* SPDX-License-Identifier: BSD-3-Clause */
+/*
+ * Authors: Costin Lupu <costin.lupu@xxxxxxxxx>
+ *
+ *
+ * Copyright (c) 2018, NEC Europe Ltd., NEC Corporation. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ *
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. Neither the name of the copyright holder nor the names of its
+ *    contributors may be used to endorse or promote products derived from
+ *    this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
+ * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ *
+ * THIS HEADER MAY NOT BE EXTRACTED OR MODIFIED IN ANY WAY.
+ */
+
+#ifndef __SYS_CDEFS_H__
+#define __SYS_CDEFS_H__
+
+#ifndef __DECONST
+#define __DECONST(type, var) ((type) (uintptr_t) (const void *) (var))
+#endif
+
+#endif /* __SYS_CDEFS_H__ */
diff --git a/lib/nolibc/stdlib.c b/lib/nolibc/stdlib.c
index 22afa77..3e12620 100644
--- a/lib/nolibc/stdlib.c
+++ b/lib/nolibc/stdlib.c
@@ -55,8 +55,6 @@
 #include <limits.h>
 #include <ctype.h>
 
-#define __DECONST(type, var) ((type)(uintptr_t)(const void *)(var))
-
 /*
  * Convert a string to an unsigned long integer.
  *
-- 
2.11.0


_______________________________________________
Minios-devel mailing list
Minios-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/minios-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.