22 |
#endif |
#endif |
23 |
|
|
24 |
#include <m4module.h> |
#include <m4module.h> |
|
#include "m4private.h" |
|
25 |
|
|
26 |
#include <gmp.h> |
#if !USE_GMP |
27 |
|
|
28 |
|
M4INIT_HANDLER (mpeval) |
29 |
|
{ |
30 |
|
const char s[] = "libgmp support was not compiled in"; |
31 |
|
|
32 |
|
if (obs) |
33 |
|
obstack_grow (obs, s, strlen(s)); |
34 |
|
} |
35 |
|
|
36 |
|
#else /* USE_GMP */ |
37 |
|
|
38 |
|
#if HAVE_GMP_H |
39 |
|
# include <gmp.h> |
40 |
|
#endif |
41 |
|
|
42 |
|
|
43 |
|
/* Rename exported symbols for dlpreload()ing. */ |
44 |
|
#define m4_builtin_table mpeval_LTX_m4_builtin_table |
45 |
|
#define m4_macro_table mpeval_LTX_m4_macro_table |
46 |
|
|
47 |
|
|
48 |
|
/* Maintain each of the builtins implemented in this modules along |
49 |
|
with their details in a single table for easy maintenance. |
50 |
|
|
51 |
|
function macros blind */ |
52 |
|
#define builtin_functions \ |
53 |
|
BUILTIN(mpeval, FALSE, TRUE ) |
54 |
|
|
55 |
|
|
56 |
|
|
57 |
#define numb_set(ans,i) mpq_set(ans,i) |
#define numb_set(ans,i) mpq_set(ans,i) |
58 |
#define numb_set_si(ans,i) mpq_set_si(*(ans),(long)i,(unsigned long)1) |
#define numb_set_si(ans,i) mpq_set_si(*(ans),(long)i,(unsigned long)1) |
90 |
|
|
91 |
#define numb_decr(n) numb_minus(n,numb_ONE) |
#define numb_decr(n) numb_minus(n,numb_ONE) |
92 |
|
|
|
/* Rename exported symbols for dlpreload()ing. */ |
|
|
#define m4_builtin_table mpeval_LTX_m4_builtin_table |
|
|
#define m4_macro_table mpeval_LTX_m4_macro_table |
|
|
|
|
|
|
|
|
/* Maintain each of the builtins implemented in this modules along |
|
|
with their details in a single table for easy maintenance. |
|
|
|
|
|
function macros blind */ |
|
|
#define builtin_functions \ |
|
|
BUILTIN(mpeval, FALSE, TRUE ) |
|
|
|
|
|
|
|
93 |
/* Generate prototypes for each builtin handler function. */ |
/* Generate prototypes for each builtin handler function. */ |
94 |
#define BUILTIN(handler, macros, blind) M4BUILTIN(handler) |
#define BUILTIN(handler, macros, blind) M4BUILTIN(handler) |
95 |
builtin_functions |
builtin_functions |
438 |
|
|
439 |
#define m4_evaluate builtin_mpeval |
#define m4_evaluate builtin_mpeval |
440 |
#include "evalparse.c" |
#include "evalparse.c" |
441 |
|
|
442 |
|
#endif /* USE_GMP */ |