Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exports some internal symbols so that we won't have to WITH_COMBINED_THREADS for Win32. #119

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions api/apiplan.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

static planner_hook_t before_planner_hook = 0, after_planner_hook = 0;

void X(set_planner_hooks)(planner_hook_t before, planner_hook_t after)
IFFTW_EXTERN void X(set_planner_hooks)(planner_hook_t before, planner_hook_t after)
{
before_planner_hook = before;
after_planner_hook = after;
Expand Down Expand Up @@ -83,7 +83,7 @@ static plan *mkplan(planner *plnr, unsigned flags,
return pln;
}

apiplan *X(mkapiplan)(int sign, unsigned flags, problem *prb)
IFFTW_EXTERN apiplan *X(mkapiplan)(int sign, unsigned flags, problem *prb)
{
apiplan *p = 0;
plan *pln;
Expand Down
2 changes: 1 addition & 1 deletion api/map-r2r-kind.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#include "api/api.h"
#include "rdft/rdft.h"

rdft_kind *X(map_r2r_kind)(int rank, const X(r2r_kind) * kind)
IFFTW_EXTERN rdft_kind *X(map_r2r_kind)(int rank, const X(r2r_kind) * kind)
{
int i;
rdft_kind *k;
Expand Down
6 changes: 3 additions & 3 deletions dft/ct.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

#include "dft/ct.h"

ct_solver *(*X(mksolver_ct_hook))(size_t, INT, int,
ct_mkinferior, ct_force_vrecursion) = 0;
IFFTW_EXTERN ct_solver *(*X(mksolver_ct_hook))(size_t, INT, int,
ct_mkinferior, ct_force_vrecursion) = 0;

typedef struct {
plan_dft super;
Expand Down Expand Up @@ -98,7 +98,7 @@ static int applicable0(const ct_solver *ego, const problem *p_, planner *plnr)
}


int X(ct_applicable)(const ct_solver *ego, const problem *p_, planner *plnr)
IFFTW_EXTERN int X(ct_applicable)(const ct_solver *ego, const problem *p_, planner *plnr)
{
const problem_dft *p;

Expand Down
3 changes: 3 additions & 0 deletions dft/ct.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ int X(ct_applicable)(const ct_solver *, const problem *, planner *);
ct_solver *X(mksolver_ct)(size_t size, INT r, int dec,
ct_mkinferior mkcldw,
ct_force_vrecursion force_vrecursionp);
#if (defined(FFTW_DLL) || defined(DLL_EXPORT)) && (defined(_WIN32) || defined(__WIN32__))
__declspec(dllimport)
#endif
extern ct_solver *(*X(mksolver_ct_hook))(size_t, INT, int,
ct_mkinferior, ct_force_vrecursion);

Expand Down
2 changes: 1 addition & 1 deletion dft/plan.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#include "dft/dft.h"

plan *X(mkplan_dft)(size_t size, const plan_adt *adt, dftapply apply)
IFFTW_EXTERN plan *X(mkplan_dft)(size_t size, const plan_adt *adt, dftapply apply)
{
plan_dft *ego;

Expand Down
8 changes: 4 additions & 4 deletions dft/problem.c
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,8 @@ static const problem_adt padt =
destroy
};

problem *X(mkproblem_dft)(const tensor *sz, const tensor *vecsz,
R *ri, R *ii, R *ro, R *io)
IFFTW_EXTERN problem *X(mkproblem_dft)(const tensor *sz, const tensor *vecsz,
R *ri, R *ii, R *ro, R *io)
{
problem_dft *ego;

Expand Down Expand Up @@ -112,8 +112,8 @@ problem *X(mkproblem_dft)(const tensor *sz, const tensor *vecsz,
}

/* Same as X(mkproblem_dft), but also destroy input tensors. */
problem *X(mkproblem_dft_d)(tensor *sz, tensor *vecsz,
R *ri, R *ii, R *ro, R *io)
IFFTW_EXTERN problem *X(mkproblem_dft_d)(tensor *sz, tensor *vecsz,
R *ri, R *ii, R *ro, R *io)
{
problem *p = X(mkproblem_dft)(sz, vecsz, ri, ii, ro, io);
X(tensor_destroy2)(vecsz, sz);
Expand Down
2 changes: 1 addition & 1 deletion dft/solve.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "dft/dft.h"

/* use the apply() operation for DFT problems */
void X(dft_solve)(const plan *ego_, const problem *p_)
IFFTW_EXTERN void X(dft_solve)(const plan *ego_, const problem *p_)
{
const plan_dft *ego = (const plan_dft *) ego_;
const problem_dft *p = (const problem_dft *) p_;
Expand Down
2 changes: 1 addition & 1 deletion kernel/alloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ void X(ifree)(void *p)
X(kernel_free)(p);
}

void X(ifree0)(void *p)
IFFTW_EXTERN void X(ifree0)(void *p)
{
/* common pattern */
if (p) X(ifree)(p);
Expand Down
2 changes: 1 addition & 1 deletion kernel/buffered.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ INT X(bufdist)(INT n, INT vl)
return n + X(modulo)(SKEW - n, SKEWMOD);
}

int X(toobig)(INT n)
IFFTW_EXTERN int X(toobig)(INT n)
{
return n > MAXBUFSZ;
}
Expand Down
2 changes: 1 addition & 1 deletion kernel/extract-reim.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
Flip real and imaginary if there the sign does not match
FFTW's idea of what the sign should be */

void X(extract_reim)(int sign, R *c, R **r, R **i)
IFFTW_EXTERN void X(extract_reim)(int sign, R *c, R **r, R **i)
{
if (sign == FFT_SIGN) {
*r = c + 0;
Expand Down
6 changes: 3 additions & 3 deletions kernel/md5-1.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,20 +29,20 @@ void X(md5putb)(md5 *p, const void *d_, size_t len)
X(md5putc)(p, d[i]);
}

void X(md5puts)(md5 *p, const char *s)
IFFTW_EXTERN void X(md5puts)(md5 *p, const char *s)
{
/* also hash final '\0' */
do {
X(md5putc)(p, (unsigned)(*s & 0xFF));
} while(*s++);
}

void X(md5int)(md5 *p, int i)
IFFTW_EXTERN void X(md5int)(md5 *p, int i)
{
X(md5putb)(p, &i, sizeof(i));
}

void X(md5INT)(md5 *p, INT i)
IFFTW_EXTERN void X(md5INT)(md5 *p, INT i)
{
X(md5putb)(p, &i, sizeof(i));
}
Expand Down
2 changes: 1 addition & 1 deletion kernel/minmax.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#include "kernel/ifftw.h"

INT X(imax)(INT a, INT b)
IFFTW_EXTERN INT X(imax)(INT a, INT b)
{
return (a > b) ? a : b;
}
Expand Down
8 changes: 4 additions & 4 deletions kernel/ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@

#include "kernel/ifftw.h"

void X(ops_zero)(opcnt *dst)
IFFTW_EXTERN void X(ops_zero)(opcnt *dst)
{
dst->add = dst->mul = dst->fma = dst->other = 0;
}

void X(ops_cpy)(const opcnt *src, opcnt *dst)
IFFTW_EXTERN void X(ops_cpy)(const opcnt *src, opcnt *dst)
{
*dst = *src;
}
Expand All @@ -45,12 +45,12 @@ void X(ops_madd)(INT m, const opcnt *a, const opcnt *b, opcnt *dst)
dst->other = m * a->other + b->other;
}

void X(ops_add)(const opcnt *a, const opcnt *b, opcnt *dst)
IFFTW_EXTERN void X(ops_add)(const opcnt *a, const opcnt *b, opcnt *dst)
{
X(ops_madd)(1, a, b, dst);
}

void X(ops_add2)(const opcnt *a, opcnt *dst)
IFFTW_EXTERN void X(ops_add2)(const opcnt *a, opcnt *dst)
{
X(ops_add)(a, dst, dst);
}
Expand Down
4 changes: 2 additions & 2 deletions kernel/pickdim.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ static int really_pickdim(int which_dim, const tensor *sz, int oop, int *dp)

/* Like really_pickdim, but only returns 1 if no previous "buddy"
which_dim in the buddies list would give the same dim. */
int X(pickdim)(int which_dim, const int *buddies, size_t nbuddies,
const tensor *sz, int oop, int *dp)
IFFTW_EXTERN int X(pickdim)(int which_dim, const int *buddies, size_t nbuddies,
const tensor *sz, int oop, int *dp)
{
size_t i;
int d1;
Expand Down
2 changes: 1 addition & 1 deletion kernel/plan.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ plan *X(mkplan)(size_t size, const plan_adt *adt)
/*
* destroy a plan
*/
void X(plan_destroy_internal)(plan *ego)
IFFTW_EXTERN void X(plan_destroy_internal)(plan *ego)
{
if (ego) {
A(ego->wakefulness == SLEEPY);
Expand Down
6 changes: 3 additions & 3 deletions kernel/planner.c
Original file line number Diff line number Diff line change
Expand Up @@ -965,16 +965,16 @@ void X(planner_destroy)(planner *ego)
X(ifree)(ego); /* dona eis requiem */
}

plan *X(mkplan_d)(planner *ego, problem *p)
IFFTW_EXTERN plan *X(mkplan_d)(planner *ego, problem *p)
{
plan *pln = ego->adt->mkplan(ego, p);
X(problem_destroy)(p);
return pln;
}

/* like X(mkplan_d), but sets/resets flags as well */
plan *X(mkplan_f_d)(planner *ego, problem *p,
unsigned l_set, unsigned u_set, unsigned u_reset)
IFFTW_EXTERN plan *X(mkplan_f_d)(planner *ego, problem *p,
unsigned l_set, unsigned u_set, unsigned u_reset)
{
flags_t oflags = ego->flags;
plan *pln;
Expand Down
8 changes: 4 additions & 4 deletions kernel/primes.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ INT X(find_generator)(INT p)

/* Return first prime divisor of n (It would be at best slightly faster to
search a static table of primes; there are 6542 primes < 2^16.) */
INT X(first_divisor)(INT n)
IFFTW_EXTERN INT X(first_divisor)(INT n)
{
INT i;
if (n <= 1)
Expand All @@ -136,7 +136,7 @@ INT X(first_divisor)(INT n)
return n;
}

int X(is_prime)(INT n)
IFFTW_EXTERN int X(is_prime)(INT n)
{
return(n > 1 && X(first_divisor)(n) == n);
}
Expand All @@ -156,7 +156,7 @@ int X(factors_into)(INT n, const INT *primes)
}

/* integer square root. Return floor(sqrt(N)) */
INT X(isqrt)(INT n)
IFFTW_EXTERN INT X(isqrt)(INT n)
{
INT guess, iguess;

Expand All @@ -180,7 +180,7 @@ static INT isqrt_maybe(INT n)
}

#define divides(a, b) (((b) % (a)) == 0)
INT X(choose_radix)(INT r, INT n)
IFFTW_EXTERN INT X(choose_radix)(INT r, INT n)
{
if (r > 0) {
if (divides(r, n)) return r;
Expand Down
2 changes: 1 addition & 1 deletion kernel/problem.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include "kernel/ifftw.h"

/* constructor */
problem *X(mkproblem)(size_t sz, const problem_adt *adt)
IFFTW_EXTERN problem *X(mkproblem)(size_t sz, const problem_adt *adt)
{
problem *p = (problem *)MALLOC(sz, PROBLEMS);

Expand Down
4 changes: 2 additions & 2 deletions kernel/solver.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#include "kernel/ifftw.h"

solver *X(mksolver)(size_t size, const solver_adt *adt)
IFFTW_EXTERN solver *X(mksolver)(size_t size, const solver_adt *adt)
{
solver *s = (solver *)MALLOC(size, SOLVERS);

Expand All @@ -44,7 +44,7 @@ void X(solver_destroy)(solver *ego)
}
}

void X(solver_register)(planner *plnr, solver *s)
IFFTW_EXTERN void X(solver_register)(planner *plnr, solver *s)
{
plnr->adt->register_solver(plnr, s);
}
2 changes: 1 addition & 1 deletion kernel/solvtab.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#include "kernel/ifftw.h"

void X(solvtab_exec)(const solvtab tbl, planner *p)
IFFTW_EXTERN void X(solvtab_exec)(const solvtab tbl, planner *p)
{
for (; tbl->reg_nam; ++tbl) {
p->cur_reg_nam = tbl->reg_nam;
Expand Down
8 changes: 4 additions & 4 deletions kernel/tensor.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

#include "kernel/ifftw.h"

tensor *X(mktensor)(int rnk)
IFFTW_EXTERN tensor *X(mktensor)(int rnk)
{
tensor *x;

Expand Down Expand Up @@ -51,15 +51,15 @@ tensor *X(mktensor)(int rnk)
return x;
}

void X(tensor_destroy)(tensor *sz)
IFFTW_EXTERN void X(tensor_destroy)(tensor *sz)
{
#if !defined(STRUCT_HACK_C99) && !defined(STRUCT_HACK_KR)
X(ifree0)(sz->dims);
#endif
X(ifree)(sz);
}

INT X(tensor_sz)(const tensor *sz)
IFFTW_EXTERN INT X(tensor_sz)(const tensor *sz)
{
int i;
INT n = 1;
Expand Down Expand Up @@ -88,7 +88,7 @@ void X(tensor_md5)(md5 *p, const tensor *t)

/* treat a (rank <= 1)-tensor as a rank-1 tensor, extracting
appropriate n, is, and os components */
int X(tensor_tornk1)(const tensor *t, INT *n, INT *is, INT *os)
IFFTW_EXTERN int X(tensor_tornk1)(const tensor *t, INT *n, INT *is, INT *os)
{
A(t->rnk <= 1);
if (t->rnk == 1) {
Expand Down
4 changes: 2 additions & 2 deletions kernel/tensor1.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@

#include "kernel/ifftw.h"

tensor *X(mktensor_0d)(void)
IFFTW_EXTERN tensor *X(mktensor_0d)(void)
{
return X(mktensor(0));
}

tensor *X(mktensor_1d)(INT n, INT is, INT os)
IFFTW_EXTERN tensor *X(mktensor_1d)(INT n, INT is, INT os)
{
tensor *x = X(mktensor)(1);
x->dims[0].n = n;
Expand Down
10 changes: 5 additions & 5 deletions kernel/tensor2.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

#include "kernel/ifftw.h"

tensor *X(mktensor_2d)(INT n0, INT is0, INT os0,
INT n1, INT is1, INT os1)
IFFTW_EXTERN tensor *X(mktensor_2d)(INT n0, INT is0, INT os0,
INT n1, INT is1, INT os1)
{
tensor *x = X(mktensor)(2);
x->dims[0].n = n0;
Expand All @@ -35,9 +35,9 @@ tensor *X(mktensor_2d)(INT n0, INT is0, INT os0,
}


tensor *X(mktensor_3d)(INT n0, INT is0, INT os0,
INT n1, INT is1, INT os1,
INT n2, INT is2, INT os2)
IFFTW_EXTERN tensor *X(mktensor_3d)(INT n0, INT is0, INT os0,
INT n1, INT is1, INT os1,
INT n2, INT is2, INT os2)
{
tensor *x = X(mktensor)(3);
x->dims[0].n = n0;
Expand Down
Loading