FLTK logo

Re: [fltk.coredev] fltk-1.4 fluid build broken on 32-bit mingw

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.coredev  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: fltk-1.4 fluid build broken on 32-bit mingw Bill Spitzak Sep 28, 2021  
 
Can you #undef fileno?
I agree that working around Microsoft stupidities are best done with a local patch, and not unnecessarily changing the code that works on other platforms (ie don't rename fileno!)


On Mon, Sep 27, 2021 at 10:35 PM Ian MacArthur <imacarthur@gmail.com> wrote:
On 27 Sep 2021, at 19:17, Albrecht Schlosser wrote:
>
> On 9/27/21 1:14 PM imacarthur wrote:
>> This has likely been broken (for me) for a bit, but I only checked the logs from my build script today, after trying to build on a new WIn10 laptop...
>>
>> FWIW, the 64-bit build is fine, which possibly explains why I never noticed there was an issue: The build machine runs a different gcc variant for the 32-bit and 64-bit targets, for obscure historical reasons...
>> ...
>> The crux is this code, added to fluid.cxx in 1.4:
>>
>>   // returns fileno(FILE*):
>>   // (file must be open, i.e. _fpt must be non-null)
>>   // *FIXME* we should find a better solution for the 'fileno' issue
>>   int fileno() const {
>> #ifdef _MSC_VER
>>     return _fileno(_fpt); // suppress MSVC warning
>> #else
>>     return ::fileno(_fpt);
>> #endif
>>   } // non null if file is open
>>
>> Which chokes on my 32-bit build because the "stdio.h" in that system defines: [...]
>
> Ooh, I wouldn't have expected that a (MinGW) system defines a macro for fileno. I tried to fix one of these silly MS warnings, but using 'fileno' as a method name seems to have been a bad idea.

Yes, it struck me as an odd thing for the header to do - and it seems to be peculiar to that flavour of mingw (which is from the “original” mingw, as it were) as the “other” mingw variants I have on that machine do not seem to have that “feature”...


>
> I'm afraid I can't build in that environment, so I'd like to ask you to try a fix:
>
> We can probably fix this by renaming our own 'fileno' method to 'filno' to avoid the name clash, see attached diff. Can you please try if this fixes the issue?
>
> Just in case '::fileno()' chokes as well, you can try to remove the '::' since we shouldn't have a conflict after the rename to 'filno’.

I’ll need to do it tomorrow, when I have access to the same machine - for consistency, if nothing else!



--
You received this message because you are subscribed to the Google Groups "fltk.coredev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkcoredev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkcoredev/20E0399E-036F-43AB-ABA9-9BA918D87E06%40gmail.com.

--
You received this message because you are subscribed to the Google Groups "fltk.coredev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkcoredev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkcoredev/CAL-8oAiKxJO6P9AZzVDz522-37G2-bLTyvDynQZ5a8Wd3kUraA%40mail.gmail.com.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.