Ticket #11992: 11992-gmp-types.patch

File 11992-gmp-types.patch, 1.3 KB (added by robertwb, 10 years ago)
  • sage/libs/gmp/types.pxd

    # HG changeset patch
    # User Robert Bradshaw <robertwb@math.washington.edu>
    # Date 1320474013 25200
    # Node ID 1f1d21563c693e236582e5cc688ba83dced8568d
    # Parent  1b021b4d026aeced55260960803f6ec78f3eaeb9
    Trac 11992 - correct gmp type declarations.
    
    diff --git a/sage/libs/gmp/types.pxd b/sage/libs/gmp/types.pxd
    a b  
    1010    ctypedef long mp_limb_t
    1111    ctypedef mp_limb_t* mp_ptr
    1212
    13     # User-level types
    14     ctypedef void* mpz_t
    15     ctypedef void* mpq_t
    16     ctypedef void* mpf_t
    17     ctypedef void* gmp_randstate_t
    18    
    19     # This internal structure is not guaranteed to stay the same with future releases of gmp.
    20     # We declare mpz_t as a void* because one is supposed to treat it as a black box.
     13    # Internal structure, not guaranteed to stay the same with future releases of gmp.
    2114    ctypedef struct __mpz_struct:
    2215        int _mp_alloc
    2316        int _mp_size
    2417        mp_ptr _mp_d
     18
     19    ctypedef struct __mpq_struct:
     20        pass
     21
     22    ctypedef struct __mpf_struct:
     23        pass
     24
     25    # User-level types
     26    ctypedef __mpz_struct mpz_t[1]
     27    ctypedef __mpq_struct mpq_t[1]
     28    ctypedef __mpf_struct mpf_t[1]
     29
     30    ctypedef __mpz_struct *mpz_ptr
     31    ctypedef __mpq_struct *mpq_ptr
     32    ctypedef __mpf_struct *mpf_ptr
     33
     34    ctypedef void* gmp_randstate_t