Closed albinahlback closed 1 month ago
It's annoying to have to include specific system headers before header files to use standard functions, e.g. <string.h>
before <mpoly.h>
for mpoly_copy_monomials
. We might as well deinline, or replace memcpy
with a loop.
It's annoying to have to include specific system headers before header files to use standard functions, e.g.
<string.h>
before<mpoly.h>
formpoly_copy_monomials
. We might as well deinline, or replacememcpy
with a loop.
How about something like
#if BUILDING_FLINT
# define mpoly_copy_monomials(bla...) ...
#else
/* Declare symbol */
#endif
So that it actually evaluate to memcpy
when building the library?
-1 to BUILDING_FLINT
.
If the string.h
inclusion is a problem, not inlining this function seems like the easiest solution.
I think this is the best solution. If the compiler is GCC compatible, it will provide __builtin_memcpy
, and so we simply expand to that. Otherwise, just use the symbol.
string.h
inclusion frommpoly.h
by makingmpoly_copy_monomials
, but still providing a symbol.ulong_extras.h
inclusions.fmpz_vec.h
.nmod_poly
.fmpz_mul2_uiui
and deinlinefmpz_divexact2_uiui
(with a slight modification for GNU compilers).longlong.h
inclusion fromfmpz.h
.MAG_FIXMUL
for 32-bit systems, so one can removelonglong.h
inclusion there completely.arb_mat.h
andacb_mat.h
via deinlining and removing, now, redundant headers.n_[cf]log(X, 2)
toFLINT_[CF]LOG2(X)
acb.h
inclusion fromacb_dirichlet.h