bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

windres and cmd.exe command line limit


From: Joe Burmeister
Subject: windres and cmd.exe command line limit
Date: Tue, 08 May 2012 10:17:38 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1

Hi,

I've been doing some QT work with MinGW and run up against that windres.exe uses popen, which on Windows calls cmd.exe, which only has a 8192 character limit.

Building something in QT (which sometimes has masses of defines) in Windows with MinGW, was failing with "command line is too long".
I felt the correct thing was that windres.exe didn't have this limit on Windows, so I've implemented an alternative popen for Windows with a larger character limit of 32768.

Include the attached file in your build and in resrc.c change:


#if defined (_WIN32) && ! defined (__CYGWIN__)
#define popen    _popen

#define pclose    _pclose
#endif


to:

#if defined (_WIN32) && ! defined (__CYGWIN__)
extern FILE *win_popen_biglimit(const char *command,const char *mode );
extern int win_pclose_biglimit(FILE *stream);
#define popen    win_popen_biglimit
#define pclose    win_pclose_biglimit
#endif



Of course solve this how ever you want, but this is the direction I think it should go. This can "just work" better than it is. It would be better if cmd.exe didn't have this low limit, but it does and I doubt MS are going to fix it anytime soon and even if they did, it wouldn't help the people running or targeting the existing version of Windows.

Hope this is useful,


Joe

Attachment: win_popen.c
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]