From 310460c1252b8d8af6943e85199e246b59eb7348 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albin=20Ahlb=C3=A4ck?= Date: Fri, 11 Oct 2024 23:45:22 +0200 Subject: [PATCH] Only include headers before `extern "C"` --- src/fexpr.h | 8 ++++---- src/fexpr_builtin.h | 4 ++-- src/fmpz_mpoly_q.h | 8 ++++---- src/qqbar.h | 8 ++++---- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/fexpr.h b/src/fexpr.h index 3c56e31325..5a66dee217 100644 --- a/src/fexpr.h +++ b/src/fexpr.h @@ -18,14 +18,14 @@ #define FEXPR_INLINE static inline #endif -#ifdef __cplusplus -extern "C" { -#endif - #include "mpoly_types.h" #include "arf_types.h" #include "gr_types.h" +#ifdef __cplusplus +extern "C" { +#endif + /* FIXME: We need calcium_stream in ca_types.h, but this header includes qqbar.h which conditionally defines functions using fexpr_t if and only if FEXPR_H is defined. And at this point FEXPR_H is defined, but not fexpr_t... */ diff --git a/src/fexpr_builtin.h b/src/fexpr_builtin.h index 8f3394e35a..78f86ccf35 100644 --- a/src/fexpr_builtin.h +++ b/src/fexpr_builtin.h @@ -18,12 +18,12 @@ #define FEXPR_BUILTIN_INLINE static inline #endif +#include "fexpr.h" + #ifdef __cplusplus extern "C" { #endif -#include "fexpr.h" - /* Builtin symbols */ /* Must be listed in alphabetical order with corresponding entry diff --git a/src/fmpz_mpoly_q.h b/src/fmpz_mpoly_q.h index 9abd34f6c8..d42b42ef1d 100644 --- a/src/fmpz_mpoly_q.h +++ b/src/fmpz_mpoly_q.h @@ -18,15 +18,15 @@ #define FMPZ_MPOLY_Q_INLINE static inline #endif -#ifdef __cplusplus -extern "C" { -#endif - #include "fmpz.h" #include "fmpz_vec.h" #include "fmpz_mpoly.h" #include "acb_types.h" +#ifdef __cplusplus +extern "C" { +#endif + #define fmpz_mpoly_q_numref(x) (&((x)->num)) #define fmpz_mpoly_q_denref(x) (&((x)->den)) diff --git a/src/qqbar.h b/src/qqbar.h index a0b78ba165..b17df6f2cc 100644 --- a/src/qqbar.h +++ b/src/qqbar.h @@ -18,15 +18,15 @@ #define QQBAR_INLINE static inline #endif -#ifdef __cplusplus -extern "C" { -#endif - #include "fmpz_types.h" #include "fmpq_types.h" #include "mpoly_types.h" #include "acb.h" +#ifdef __cplusplus +extern "C" { +#endif + typedef struct { fmpz_poly_struct poly;