From c37443f374d1679908de8d6ed7d85d2c04b13496 Mon Sep 17 00:00:00 2001 From: Fredrik Johansson Date: Thu, 12 Oct 2023 17:07:52 +0200 Subject: [PATCH] export inline functions in acb_modular.h --- src/acb_modular.h | 18 ++++++++++++------ src/acb_modular/inlines.c | 14 ++++++++++++++ 2 files changed, 26 insertions(+), 6 deletions(-) create mode 100644 src/acb_modular/inlines.c diff --git a/src/acb_modular.h b/src/acb_modular.h index 48bba110d1..97d266e995 100644 --- a/src/acb_modular.h +++ b/src/acb_modular.h @@ -12,6 +12,12 @@ #ifndef ACB_MODULAR_H #define ACB_MODULAR_H +#ifdef ACB_MODULAR_INLINES_C +#define ACB_MODULAR_INLINE +#else +#define ACB_MODULAR_INLINE static __inline__ +#endif + #include "fmpz.h" #include "acb_types.h" @@ -30,7 +36,7 @@ psl2z_struct; typedef psl2z_struct psl2z_t[1]; -static __inline__ void +ACB_MODULAR_INLINE void psl2z_init(psl2z_t g) { fmpz_init(&g->a); @@ -41,7 +47,7 @@ psl2z_init(psl2z_t g) fmpz_one(&g->d); } -static __inline__ void +ACB_MODULAR_INLINE void psl2z_clear(psl2z_t g) { fmpz_clear(&g->a); @@ -50,7 +56,7 @@ psl2z_clear(psl2z_t g) fmpz_clear(&g->d); } -static __inline__ void +ACB_MODULAR_INLINE void psl2z_swap(psl2z_t f, psl2z_t g) { psl2z_struct h = *f; @@ -58,7 +64,7 @@ psl2z_swap(psl2z_t f, psl2z_t g) *g = h; } -static __inline__ void +ACB_MODULAR_INLINE void psl2z_set(psl2z_t h, const psl2z_t g) { fmpz_set(&h->a, &g->a); @@ -67,7 +73,7 @@ psl2z_set(psl2z_t h, const psl2z_t g) fmpz_set(&h->d, &g->d); } -static __inline__ void +ACB_MODULAR_INLINE void psl2z_one(psl2z_t g) { fmpz_one(&g->a); @@ -82,7 +88,7 @@ void psl2z_fprint(FILE * file, const psl2z_t g); void psl2z_print(const psl2z_t g); -static __inline__ int +ACB_MODULAR_INLINE int psl2z_equal(const psl2z_t f, const psl2z_t g) { return fmpz_equal(&f->a, &g->a) diff --git a/src/acb_modular/inlines.c b/src/acb_modular/inlines.c new file mode 100644 index 0000000000..b281f3e6e4 --- /dev/null +++ b/src/acb_modular/inlines.c @@ -0,0 +1,14 @@ +/* + Copyright (C) 2020 Fredrik Johansson + + This file is part of Arb. + + Arb is free software: you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License (LGPL) as published + by the Free Software Foundation; either version 2.1 of the License, or + (at your option) any later version. See . +*/ + +#define ACB_MODULAR_INLINES_C +#include "acb_modular.h" +