diff --git a/Changelog.txt b/Changelog.txt index 7df8c0c19..301929aef 100644 --- a/Changelog.txt +++ b/Changelog.txt @@ -10,6 +10,8 @@ common: on github) * Support "void goto_set_num_threads(int num_threads)" and "void openblas_set_num_threads(int num_threads)" when USE_OPENMP=1 + * Added extern "C" to support C++. Thank Tasio for the patch(Refs + issue #21 on github) x86/x86_64: * diff --git a/cblas.h b/cblas.h index 4beae7ad5..34adc5e99 100644 --- a/cblas.h +++ b/cblas.h @@ -1,6 +1,11 @@ #ifndef CBLAS_H #define CBLAS_H +#ifdef __cplusplus +extern "C" { + /* Assume C declarations for C++ */ +#endif /* __cplusplus */ + #include #include "common.h" @@ -273,4 +278,10 @@ void cblas_zher2k(enum CBLAS_ORDER Order, enum CBLAS_UPLO Uplo, enum CBLAS_TRANS double *alpha, double *A, blasint lda, double *B, blasint ldb, double beta, double *C, blasint ldc); void cblas_xerbla(blasint p, char *rout, char *form, ...); + +#ifdef __cplusplus +} + +#endif /* __cplusplus */ + #endif diff --git a/common.h b/common.h index a481b2acb..1a7dd434a 100644 --- a/common.h +++ b/common.h @@ -39,6 +39,11 @@ #ifndef COMMON_H #define COMMON_H +#ifdef __cplusplus +extern "C" { + /* Assume C declarations for C++ */ +#endif /* __cplusplus */ + #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif @@ -607,4 +612,9 @@ extern int gotoblas_profile; #define PRINT_DEBUG_NAME if (readenv("GOTO_DEBUG")) fprintf(stderr, "GotoBLAS : %s\n", CHAR_NAME) #endif +#ifdef __cplusplus +} + +#endif /* __cplusplus */ + #endif