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).
--
A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
Dave
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.
Is there any reason not to use "unsigned long", rather than #define
ulong to it?
Dave
No.
In which case I'd suggest that removing the use of "ulong" and just
using "unsigned long" would be the best solution.
Dave
Best of luck.
Well, the upstream developer should seriously consider fixing this.
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
On Apr 25, 10:32 pm, David Kirkby <david.kir...@onetel.net> wrote:
> On 25 April 2011 15:25, Dima Pasechnik <dimp...@gmail.com> wrote:
>
> >> > #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
>
> I doubt Bill will change it, but personally I feel there's no need to
> use ulong at all, and he should use "unsigned long" in his code. He
> has invented something that saves 6 byes every time it is used, but
> causes unnecessary complications.
>
> I think the KISS principle should apply here.
>
> Dave