Skip to content

Commit 4352a58

Browse files
authored
Merge pull request #2090 from albinahlback/cpp_include_fix
Only include headers before `extern "C"`
2 parents 0f1659a + 310460c commit 4352a58

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

src/fexpr.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@
1818
#define FEXPR_INLINE static inline
1919
#endif
2020

21-
#ifdef __cplusplus
22-
extern "C" {
23-
#endif
24-
2521
#include "mpoly_types.h"
2622
#include "arf_types.h"
2723
#include "gr_types.h"
2824

25+
#ifdef __cplusplus
26+
extern "C" {
27+
#endif
28+
2929
/* FIXME: We need calcium_stream in ca_types.h, but this header includes qqbar.h
3030
which conditionally defines functions using fexpr_t if and only if FEXPR_H is
3131
defined. And at this point FEXPR_H is defined, but not fexpr_t... */

src/fexpr_builtin.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@
1818
#define FEXPR_BUILTIN_INLINE static inline
1919
#endif
2020

21+
#include "fexpr.h"
22+
2123
#ifdef __cplusplus
2224
extern "C" {
2325
#endif
2426

25-
#include "fexpr.h"
26-
2727
/* Builtin symbols */
2828

2929
/* Must be listed in alphabetical order with corresponding entry

src/fmpz_mpoly_q.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818
#define FMPZ_MPOLY_Q_INLINE static inline
1919
#endif
2020

21-
#ifdef __cplusplus
22-
extern "C" {
23-
#endif
24-
2521
#include "fmpz.h"
2622
#include "fmpz_vec.h"
2723
#include "fmpz_mpoly.h"
2824
#include "acb_types.h"
2925

26+
#ifdef __cplusplus
27+
extern "C" {
28+
#endif
29+
3030
#define fmpz_mpoly_q_numref(x) (&((x)->num))
3131
#define fmpz_mpoly_q_denref(x) (&((x)->den))
3232

src/qqbar.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@
1818
#define QQBAR_INLINE static inline
1919
#endif
2020

21-
#ifdef __cplusplus
22-
extern "C" {
23-
#endif
24-
2521
#include "fmpz_types.h"
2622
#include "fmpq_types.h"
2723
#include "mpoly_types.h"
2824
#include "acb.h"
2925

26+
#ifdef __cplusplus
27+
extern "C" {
28+
#endif
29+
3030
typedef struct
3131
{
3232
fmpz_poly_struct poly;

0 commit comments

Comments
 (0)