Skip to contentSkip to conversation

examples/performance-thread: add c++ ifdefs

PATCH In review Keith Wiles 2 participants 2 messages Apr 16, 2017 – Apr 21, 2017

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 examples/performance-thread: add c++ ifdefs

---
v2 - change ctx.h to be 664 permissions.

 examples/performance-thread/common/arch/x86/ctx.h     | 8 ++++++++
 examples/performance-thread/common/lthread.h          | 8 ++++++++
 examples/performance-thread/common/lthread_api.h      | 8 ++++++++
 examples/performance-thread/common/lthread_cond.h     | 8 ++++++++
 examples/performance-thread/common/lthread_diag.h     | 9 +++++++++
 examples/performance-thread/common/lthread_diag_api.h | 8 ++++++++
 examples/performance-thread/common/lthread_int.h      | 8 ++++++++
 examples/performance-thread/common/lthread_mutex.h    | 8 ++++++++
 examples/performance-thread/common/lthread_objcache.h | 7 +++++++
 examples/performance-thread/common/lthread_pool.h     | 7 +++++++
 examples/performance-thread/common/lthread_queue.h    | 7 +++++++
 examples/performance-thread/common/lthread_sched.h    | 7 +++++++
 examples/performance-thread/common/lthread_timer.h    | 7 +++++++
 examples/performance-thread/common/lthread_tls.h      | 7 +++++++
 14 files changed, 107 insertions(+)
examples/performance-thread/common/arch/x86/ctx.h +8 -0
index 03860508e..a41ce05a5 100644
@@ -35,6 +35,10 @@
 #ifndef CTX_H
 #define CTX_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 /*
  * CPU context registers
  */
@@ -54,4 +58,8 @@ void
 ctx_switch(struct ctx *new_ctx, struct ctx *curr_ctx);
 
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* RTE_CTX_H_ */
examples/performance-thread/common/lthread.h +8 -0
index 8c77af82e..5c2c1a5f0 100644
@@ -62,6 +62,10 @@
 #ifndef LTHREAD_H_
 #define LTHREAD_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <rte_per_lcore.h>
 
 #include "lthread_api.h"
@@ -96,4 +100,8 @@ _lthread_init(struct lthread *lt,
 
 void _lthread_set_stack(struct lthread *lt, void *stack, size_t stack_size);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif				/* LTHREAD_H_ */
examples/performance-thread/common/lthread_api.h +8 -0
index ec976103f..ff245a082 100644
@@ -124,6 +124,10 @@
 #ifndef LTHREAD_H
 #define LTHREAD_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <stdint.h>
 #include <sys/socket.h>
 #include <fcntl.h>
@@ -829,4 +833,8 @@ int lthread_cond_signal(struct lthread_cond *c);
   */
 int lthread_cond_broadcast(struct lthread_cond *c);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif				/* LTHREAD_H */
examples/performance-thread/common/lthread_cond.h +8 -0
index 5bd02a7dc..5e5f14be9 100644
@@ -62,6 +62,10 @@
 #ifndef LTHREAD_COND_H_
 #define LTHREAD_COND_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "lthread_queue.h"
 
 #define MAX_COND_NAME_SIZE 64
@@ -74,4 +78,8 @@ struct lthread_cond {
 	uint64_t diag_ref;	/* optional ref to user diag data */
 } __rte_cache_aligned;
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif				/* LTHREAD_COND_H_ */
examples/performance-thread/common/lthread_diag.h +9 -0
index 2877d311c..3dce8e0eb 100644
@@ -34,6 +34,10 @@
 #ifndef LTHREAD_DIAG_H_
 #define LTHREAD_DIAG_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <stdint.h>
 #include <inttypes.h>
 
@@ -129,4 +133,9 @@ extern uint64_t diag_mask;
 #define DIAG_USED __rte_unused
 
 #endif				/* LTHREAD_DIAG */
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif				/* LTHREAD_DIAG_H_ */
examples/performance-thread/common/lthread_diag_api.h +8 -0
index 7ee514f8b..2fda0951f 100644
@@ -33,6 +33,10 @@
 #ifndef LTHREAD_DIAG_API_H_
 #define LTHREAD_DIAG_API_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <stdint.h>
 #include <inttypes.h>
 
@@ -322,4 +326,8 @@ lthread_cond_diag_ref(struct lthread_cond *c);
 uint64_t
 lthread_mutex_diag_ref(struct lthread_mutex *m);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif				/* LTHREAD_DIAG_API_H_ */
examples/performance-thread/common/lthread_int.h +8 -0
index 031d8afc4..3f7fb92df 100644
@@ -62,6 +62,10 @@
 #include <lthread_api.h>
 #define LTHREAD_INT_H
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <stdint.h>
 #include <sys/time.h>
 #include <sys/types.h>
@@ -197,4 +201,8 @@ struct lthread {
 	uint64_t diag_ref;			/* ref to user diag data */
 } __rte_cache_aligned;
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif				/* LTHREAD_INT_H */
examples/performance-thread/common/lthread_mutex.h +8 -0
index 4d30b2e71..e78db91dc 100644
@@ -35,6 +35,10 @@
 #ifndef LTHREAD_MUTEX_H_
 #define LTHREAD_MUTEX_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "lthread_queue.h"
 
 
@@ -49,4 +53,8 @@ struct lthread_mutex {
 	uint64_t		diag_ref; /* optional ref to user diag data */
 } __rte_cache_aligned;
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif /* LTHREAD_MUTEX_H_ */
examples/performance-thread/common/lthread_objcache.h +7 -0
index d7e35825f..6e5195ba5 100644
@@ -33,6 +33,10 @@
 #ifndef LTHREAD_OBJCACHE_H_
 #define LTHREAD_OBJCACHE_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <string.h>
 
 #include <rte_per_lcore.h>
@@ -154,5 +158,8 @@ _lthread_objcache_free(struct lthread_objcache *c, void *obj)
 }
 
 
+#ifdef __cplusplus
+}
+#endif
 
 #endif				/* LTHREAD_OBJCACHE_H_ */
examples/performance-thread/common/lthread_pool.h +7 -0
index 27680eab9..fb0c578b0 100644
@@ -69,6 +69,10 @@
 #ifndef LTHREAD_POOL_H_
 #define LTHREAD_POOL_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <rte_malloc.h>
 #include <rte_per_lcore.h>
 #include <rte_log.h>
@@ -328,5 +332,8 @@ _qnode_pool_destroy(struct qnode_pool *p)
 	return 0;
 }
 
+#ifdef __cplusplus
+}
+#endif
 
 #endif				/* LTHREAD_POOL_H_ */
examples/performance-thread/common/lthread_queue.h +7 -0
index 2c55fcec7..4fc2074e4 100644
@@ -69,6 +69,10 @@
 #ifndef LTHREAD_QUEUE_H_
 #define LTHREAD_QUEUE_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <string.h>
 
 #include <rte_prefetch.h>
@@ -298,5 +302,8 @@ _lthread_queue_remove(struct lthread_queue *q)
 	return NULL;
 }
 
+#ifdef __cplusplus
+}
+#endif
 
 #endif				/* LTHREAD_QUEUE_H_ */
examples/performance-thread/common/lthread_sched.h +7 -0
index 4ce56c27c..7cddda9c5 100644
@@ -62,6 +62,10 @@
 #ifndef LTHREAD_SCHED_H_
 #define LTHREAD_SCHED_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "lthread_int.h"
 #include "lthread_queue.h"
 #include "lthread_objcache.h"
@@ -148,5 +152,8 @@ extern struct lthread_sched *schedcore[];
 void _sched_timer_cb(struct rte_timer *tim, void *arg);
 void _sched_shutdown(__rte_unused void *arg);
 
+#ifdef __cplusplus
+}
+#endif
 
 #endif				/* LTHREAD_SCHED_H_ */
examples/performance-thread/common/lthread_timer.h +7 -0
index b5e6fb0ef..b044b902b 100644
@@ -35,6 +35,10 @@
 #ifndef LTHREAD_TIMER_H_
 #define LTHREAD_TIMER_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "lthread_int.h"
 #include "lthread_sched.h"
 
@@ -75,5 +79,8 @@ _timer_stop(struct lthread *lt)
 	}
 }
 
+#ifdef __cplusplus
+}
+#endif
 
 #endif /* LTHREAD_TIMER_H_ */
examples/performance-thread/common/lthread_tls.h +7 -0
index 86cbfadcc..fff3c0db8 100644
@@ -34,6 +34,10 @@
 #ifndef LTHREAD_TLS_H_
 #define LTHREAD_TLS_H_
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include "lthread_api.h"
 
 #define RTE_PER_LTHREAD_SECTION_SIZE \
@@ -53,5 +57,8 @@ void _lthread_tls_destroy(struct lthread *lt);
 void _lthread_key_pool_init(void);
 void _lthread_tls_alloc(struct lthread *lt);
 
+#ifdef __cplusplus
+}
+#endif
 
 #endif				/* LTHREAD_TLS_H_ */
Signature · 1 line
2.12.1.430.gafd672630
#1 lore raw

16/04/2017 15:33, Keith Wiles:

Quoted 4 lines

---
v2 - change ctx.h to be 664 permissions.

Quoted 15 lines
 examples/performance-thread/common/arch/x86/ctx.h     | 8 ++++++++
 examples/performance-thread/common/lthread.h          | 8 ++++++++
 examples/performance-thread/common/lthread_api.h      | 8 ++++++++
 examples/performance-thread/common/lthread_cond.h     | 8 ++++++++
 examples/performance-thread/common/lthread_diag.h     | 9 +++++++++
 examples/performance-thread/common/lthread_diag_api.h | 8 ++++++++
 examples/performance-thread/common/lthread_int.h      | 8 ++++++++
 examples/performance-thread/common/lthread_mutex.h    | 8 ++++++++
 examples/performance-thread/common/lthread_objcache.h | 7 +++++++
 examples/performance-thread/common/lthread_pool.h     | 7 +++++++
 examples/performance-thread/common/lthread_queue.h    | 7 +++++++
 examples/performance-thread/common/lthread_sched.h    | 7 +++++++
 examples/performance-thread/common/lthread_timer.h    | 7 +++++++
 examples/performance-thread/common/lthread_tls.h      | 7 +++++++
 14 files changed, 107 insertions(+)

You have already acked the same patch from Hiroki SHIROKURA. Why re-sending with your authorship?