Skip to content

Commit

Permalink
Avoid including headers in extern "C" blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
mmuetzel committed Jun 6, 2024
1 parent a0926d6 commit fbcfdb7
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 19 deletions.
4 changes: 2 additions & 2 deletions CHOLMOD/GPU/cholmod_gpu_kernels.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@
#ifndef CHOLMODGPUKERNELS_H
#define CHOLMODGPUKERNELS_H

#include "SuiteSparse_config.h"

/* make it easy for C++ programs to include CHOLMOD */
#ifdef __cplusplus
extern "C" {
#endif

#include "SuiteSparse_config.h"

int createMapOnDevice ( int64_t *d_Map, int64_t *d_Ls, int64_t psi, int64_t nsrow );

int createRelativeMapOnDevice ( int64_t *d_Map, int64_t *d_Ls,
Expand Down
8 changes: 4 additions & 4 deletions ParU/Config/ParU.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -620,14 +620,14 @@ ParU_Info ParU_FreeControl

// The following definitions are available in both C and C++:

#ifdef __cplusplus
extern "C" {
#endif

#include <stdint.h>
#include <stdbool.h>
#include <math.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef struct ParU_C_Symbolic_struct *ParU_C_Symbolic ;
typedef struct ParU_C_Numeric_struct *ParU_C_Numeric ;
typedef struct ParU_C_Control_struct *ParU_C_Control ;
Expand Down
8 changes: 4 additions & 4 deletions ParU/Include/ParU.h
Original file line number Diff line number Diff line change
Expand Up @@ -620,14 +620,14 @@ ParU_Info ParU_FreeControl

// The following definitions are available in both C and C++:

#ifdef __cplusplus
extern "C" {
#endif

#include <stdint.h>
#include <stdbool.h>
#include <math.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef struct ParU_C_Symbolic_struct *ParU_C_Symbolic ;
typedef struct ParU_C_Numeric_struct *ParU_C_Numeric ;
typedef struct ParU_C_Control_struct *ParU_C_Control ;
Expand Down
3 changes: 0 additions & 3 deletions ParU/Tcov/paru_c_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,7 @@
}

#include "paru_cov.hpp"
extern "C"
{
#include "ParU.h"
}

int main(int argc, char **argv)
{
Expand Down
11 changes: 5 additions & 6 deletions SPQR/Include/SuiteSparseQR.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,11 @@
#include <cublas_v2.h>
#endif
#define SUITESPARSE_GPU_EXTERN_ON
extern "C"
{
#include "SuiteSparse_config.h"
#include "cholmod.h"
#include "SuiteSparseQR_definitions.h"
}

#include "SuiteSparse_config.h"
#include "cholmod.h"
#include "SuiteSparseQR_definitions.h"

#undef SUITESPARSE_GPU_EXTERN_ON

#include <complex>
Expand Down

0 comments on commit fbcfdb7

Please sign in to comment.