/[m4]/m4/modules/mpeval.c
ViewVC logotype

Diff of /m4/modules/mpeval.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by gary, Thu Sep 20 22:01:34 2001 UTC revision 1.9 by gary, Fri Sep 21 00:13:30 2001 UTC
# Line 22  Line 22 
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)
# Line 62  Line 90 
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
# Line 423  numb_rshift (number * x, const number * Line 438  numb_rshift (number * x, const number *
438    
439  #define m4_evaluate     builtin_mpeval  #define m4_evaluate     builtin_mpeval
440  #include "evalparse.c"  #include "evalparse.c"
441    
442    #endif /* USE_GMP */

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26