Allow the headers to be used when compiling c++ programs
authorKevin Klues <klueska@cs.berkeley.edu>
Tue, 10 Apr 2012 01:09:49 +0000 (18:09 -0700)
committerKevin Klues <klueska@cs.berkeley.edu>
Tue, 10 Apr 2012 01:09:49 +0000 (18:09 -0700)
kern/include/ros/ring_buffer.h
tools/compilers/gcc-glibc/glibc-2.14.1-ros/sysdeps/ros/sys/syscall.h
user/parlib/include/ros_debug.h

index 540a673..878ce7e 100644 (file)
@@ -115,7 +115,7 @@ struct __name##_sring {                                                 \
             uint8_t msg;                                                \
         } tapif_user;                                                   \
         uint8_t pvt_pad[4];                                             \
-    } private;                                                          \
+    } priv;                                                             \
     uint8_t __pad[44];                                                  \
     union __name##_sring_entry ring[1]; /* variable-length */           \
 };                                                                      \
@@ -160,7 +160,7 @@ typedef struct __name##_back_ring __name##_back_ring_t
 #define SHARED_RING_INIT(_s) do {                                       \
     (_s)->req_prod  = (_s)->rsp_prod  = 0;                              \
     (_s)->req_event = (_s)->rsp_event = 1;                              \
-    (void)memset((_s)->private.pvt_pad, 0, sizeof((_s)->private.pvt_pad)); \
+    (void)memset((_s)->priv.pvt_pad, 0, sizeof((_s)->priv.pvt_pad));    \
     (void)memset((_s)->__pad, 0, sizeof((_s)->__pad));                  \
 } while(0)
 
index 50459d4..ca49be2 100644 (file)
 #include <ros/syscall.h>
 #include <ros/event.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /**************** Functions to invoke syscalls ****************/
 /* Convenience wrapper for __ros_syscall_errno.  Most code uses this (for now)*/
 #define ros_syscall(which, a0, a1, a2, a3, a4, a5) \
@@ -39,4 +43,8 @@ extern void (*ros_syscall_blockon)(struct syscall *sysc);
  * never can, like for RTLD).  MCPs will need the 'uthread-aware' blockon. */
 void __ros_scp_syscall_blockon(struct syscall *sysc);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* _GLIBC_ROS_SYSCALL_H */
index 3378c10..77de946 100644 (file)
@@ -5,6 +5,10 @@
 #include <stdio.h>
 #include <stdarg.h>
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 void ros_debugfmt(void (*putch)(int, void**), void **putdat, const char *fmt, ...);
 void ros_vdebugfmt(void (*putch)(int, void**), void **putdat, const char *fmt, va_list);
 
@@ -18,4 +22,8 @@ int   ros_vdebug(const char *fmt, va_list);
 #define printd(args...) {}
 #endif
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* !PARLIB_INC_DEBUG_H */