Made all C headers includeable from C++.

This commit is contained in:
Atgeirr Flø Rasmussen 2010-10-12 07:44:02 +00:00
parent 7929e7d25f
commit 3cf1f1b5da
9 changed files with 82 additions and 0 deletions

View File

@ -20,6 +20,10 @@
#ifndef BLAS_LAPACK_H_INCLUDED
#define BLAS_LAPACK_H_INCLUDED
#ifdef __cplusplus
extern "C" {
#endif
#if defined(MATLAB_MEX_FILE) && MATLAB_MEX_FILE
#include <mex.h>
#undef MAT_SIZE_T
@ -92,4 +96,9 @@ double ddot_(const MAT_SIZE_T *n, const double *x, const MAT_SIZE_T *incx,
const double *y, const MAT_SIZE_T *incy);
#ifdef __cplusplus
}
#endif
#endif /* BLAS_LAPACK_H_INCLUDED */

View File

@ -20,6 +20,10 @@
#ifndef COARSE_CONN_H_INCLUDED
#define COARSE_CONN_H_INCLUDED
#ifdef __cplusplus
extern "C" {
#endif
struct coarse_topology {
int nblocks;
int nfaces;
@ -42,4 +46,9 @@ coarse_topology_create(int nc, int nf, int expct_nconn,
void
coarse_topology_destroy(struct coarse_topology *t);
#ifdef __cplusplus
}
#endif
#endif /* COARSE_CONN_H_INCLUDED */

View File

@ -20,6 +20,10 @@
#ifndef COARSE_SYS_H_INCLUDED
#define COARSE_SYS_H_INCLUDED
#ifdef __cplusplus
extern "C" {
#endif
#include "grid.h"
/* ---------------------------------------------------------------------- */
@ -76,4 +80,9 @@ coarse_sys_compute_Binv(int nb,
struct coarse_sys *sys,
double *work);
#ifdef __cplusplus
}
#endif
#endif /* COARSE_SYS_H_INCLUDED */

10
dfs.h
View File

@ -20,6 +20,16 @@
#ifndef DFS_H_INCLUDED
#define DFS_H_INCLUDED
#ifdef __cplusplus
extern "C" {
#endif
void dfs (int size, int *ia, int *ja, int *ncolors, int *color, int* work);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -20,6 +20,10 @@
#ifndef HASH_SET_H_INCLUDED
#define HASH_SET_H_INCLUDED
#ifdef __cplusplus
extern "C" {
#endif
#include <stddef.h>
@ -59,5 +63,8 @@ hash_set_insert(int k, struct hash_set *s);
size_t
hash_set_count_elms(const struct hash_set *set);
#ifdef __cplusplus
}
#endif
#endif /* HASH_SET_H_INCLUDED */

View File

@ -20,6 +20,10 @@
#ifndef HYBSYS_H_INCLUDED
#define HYBSYS_H_INCLUDED
#ifdef __cplusplus
extern "C" {
#endif
struct hybsys {
double *L; /* C2' * inv(B) * C1 - P */
double *q; /* g - F2*G */
@ -144,4 +148,10 @@ hybsys_compute_press_flux_well(int nc, const int *pgconn, int nf,
double *cpress, double *cflux,
double *wpress, double *wflux,
double *work);
#ifdef __cplusplus
}
#endif
#endif /* HYBSYS_H_INCLUDED */

View File

@ -20,6 +20,10 @@
#ifndef HYBSYS_GLOBAL_H_INCLUDED
#define HYBSYS_GLOBAL_H_INCLUDED
#ifdef __cplusplus
extern "C" {
#endif
#include "grid.h"
#include "well.h"
#include "sparse_sys.h"
@ -45,4 +49,10 @@ hybsys_global_assemble_well_sym(int ngconn_tot,
struct CSRMatrix *A,
double *b);
#ifdef __cplusplus
}
#endif
#endif /* HYBSYS_GLOBAL_H_INCLUDED */

View File

@ -20,6 +20,10 @@
#ifndef IFSH_MS_H_INCLUDED
#define IFSH_MS_H_INCLUDED
#ifdef __cplusplus
extern "C" {
#endif
#include <stddef.h>
#include "grid.h"
@ -59,4 +63,9 @@ void
ifsh_ms_press_flux(grid_t *G, struct ifsh_ms_data *h,
double *cpress, double *fflux);
#ifdef __cplusplus
}
#endif
#endif /* IFSH_MS_H_INCLUDED */

View File

@ -20,6 +20,10 @@
#ifndef PARTITION_H_INCLUDED
#define PARTITION_H_INCLUDED
#ifdef __cplusplus
extern "C" {
#endif
int
partition_unif_idx(int ndims, int nc,
const int *fine_d,
@ -50,4 +54,9 @@ partition_localidx(int nblk, const int *pi, const int *inverse,
int
partition_split_disconnected(int nc, int nneigh, const int *neigh,
int *p);
#ifdef __cplusplus
}
#endif
#endif /* PARTITION_H_INLCUDED */