librvg dynamically creates functions on the stack, which is a GNU extension and requires compiling with -z,execstack. This pattern should be avoided to improve portability.
|
/* Make a dual distribution function. */ |
|
#define MAKE_DDF(ddf, cdf, sf) \ |
|
const double ddf##__cutoff = quantile(cdf, nextafterf(.5, 1)); \ |
|
const bool ddf##__sign = signbit(ddf##__cutoff); \ |
|
bool ddf##__abort = false; \ |
|
if(0.5 < cdf(nextafter(ddf##__cutoff, -INFINITY))) { \ |
|
fprintf(stderr, "Invalid CDF detected.\n"); \ |
|
ddf##__abort = true; \ |
|
} \ |
|
if(0.5 <= sf(ddf##__cutoff)) { \ |
|
fprintf(stderr, "Invalid SF detected.\n"); \ |
|
ddf##__abort = true; \ |
|
} \ |
|
if (ddf##__abort) { \ |
|
exit(1); \ |
|
} \ |
|
void ddf(double x, bool * d, float * q) { \ |
|
if ((x < ddf##__cutoff) \ |
|
|| ((x == ddf##__cutoff) \ |
|
&& signbit(x) \ |
|
&& !(ddf##__sign))) { \ |
|
*d = 0; \ |
|
*q = cdf(x); \ |
|
} else { \ |
|
*d = 1; \ |
|
*q = sf(x); \ |
|
} \ |
|
assert(check_ddf_val(*d, *q)); \ |
|
} |
|
|
|
#endif |
librvg dynamically creates functions on the stack, which is a GNU extension and requires compiling with
-z,execstack. This pattern should be avoided to improve portability.librvg/generate.h
Lines 96 to 126 in eb31050