FLINT_ASSERT is defined in flint.h and used extensively in
ZmodF_poly.c. Also flint_heap_alloc is defined in the memory manager,
hence the inclusion of that in ZmodF_poly.c.

Therefore I don't think this fix is valid.

Bill.

On Apr 25, 3:25 pm, Dima Pasechnik <dimp...@gmail.com> wrote:
> ---------- Forwarded message ----------
> From: Dima Pasechnik <dimp...@gmail.com>
> Date: Apr 25, 10:24 pm
> Subject: #11246: flint-1.5.0.p5 defines ulong on a system with ulong a
> type
> To: sage-windows
>
> Hi Bill,
>
> On Apr 25, 3:41 am, Bill Hart <goodwillh...@googlemail.com> wrote:
>
> > On 24 April 2011 20:20, Dr. David Kirkby <david.kir...@onetel.net> wrote:
> > > On 04/24/11 12:22 PM, Dima Pasechnik wrote:
>
> > >> While trying to build Sage on Windows 7, I ran into the case of a
> > >> package defining ulong (i.e. #define ulong unsigned long),
> > >> whereas in a system header it is defined as a type.
> > >> (details on the ticket).
>
> > >> While it's trivial to make a platform-dependent fix, I wonder whether
> > >> this should be addressed in some other, more proper way
> > >> (indeed, one sees that on various linuxes this happens once in a
> > >> while, too)...
>
> > >> Dima
>
> > > #ifndef ulong
> > > #define ulong unsigned long
> > > #endif
>
> > > would not be platform specific (so fairly easy to maintain).
>
> This does not work, as the header inclusion order in ZmodF_mul.c
> does #include ZmodF_poly.h (which includes stdio.h, which in turn
> includes sys/types.h containing the typedef for ulong)
> after ZmodF.h, which includes flint.h containing #define ulong
>
> Thus the typedef is nuked, and there is no way around it with the
> given header
> order.
>
> The 1st bug is in ZmodF_mul.c, which does not need to include ZmodF.h
> at all,
> as it is included in ZmodF_poly.h
>
> The 2nd bug like this is in mpn_extras.h, where the inclusion of
> flint.h is not needed
> ---and this nukes ZmodF_mul-tuning.c
>
> The 3rd bug like this is in ZmodF_poly.c, which needs to include
> neither flint.h nor memory-manager.h
>
> After removing these includes, the spkg compiles on Cygwin.
>
> Dmitrii
>
> > What I've been doing is #undef ulong before including those header
> > files, then #define ulong unsigned long after they're included. This
> > seems to work.
>
> > Bill.

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to