Bug 3611 - Mac OSX q3cpp broken
Status: RESOLVED FIXED
Alias: None
Product: ioquake3
Classification: Unclassified
Component: Platform
Version: GIT MASTER
Hardware: Macintosh MacOS X
: P3 major
Assignee: Zachary J. Slater
QA Contact: ioquake3 bugzilla mailing list
URL:
Depends on:
Blocks:
 
Reported: 2008-04-23 13:05 EDT by Ben Millwood
Modified: 2008-04-23 13:40:34 EDT
0 users

See Also:


Attachments
getopt ->Q_getopt (1.04 KB, patch)
2008-04-23 13:08 EDT, Ben Millwood

Description Ben Millwood 2008-04-23 13:05:01 EDT
I think this is only a problem on Leopard, but q3cpp on my Mac uses the libc getopt instead of the one in tools/lcc/cpp/getopt.c
Of course, they don't do *quite* the same thing, so as a result passing any arguments to it results in either sheer insanity or a plain bus error.

Renaming the getopt function to Q_getopt seems to resolve the issue and I can now compile QVMs fine. It's not easy for me to make sure they *work*, but all signs point to yes.
Comment 1 Ben Millwood 2008-04-23 13:08:05 EDT
Created attachment 1734 [details]
getopt ->Q_getopt

This patch renames all three occurrences of the offending call. I don't know if the new name is stylistically right, but it doesn't really matter since all the q3cpp code seems to be a huge mess anyway :|
Comment 2 Tony J. White 2008-04-23 13:40:34 EDT
used "lcc_" prefix instead of "Q_" and removed unused reference in nlist.c

committed at rev 1326