소스 검색

[components][libc] add extern "C" for header file

Hao Zhu 6 년 전
부모
커밋
d3c2cb5845
1개의 변경된 파일9개의 추가작업 그리고 0개의 파일을 삭제
  1. 9 0
      components/libc/pthreads/pthread.h

+ 9 - 0
components/libc/pthreads/pthread.h

@@ -12,6 +12,11 @@
 #define __PTHREAD_H__
 
 #include <rtthread.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
 #include <posix_types.h>
 #include <sched.h>
 
@@ -262,4 +267,8 @@ int pthread_barrier_init(pthread_barrier_t           *barrier,
 
 int pthread_barrier_wait(pthread_barrier_t *barrier);
 
+#ifdef __cplusplus
+}
+#endif
+
 #endif