Opened 14 years ago

Closed 14 years ago

Last modified 5 years ago

#4763 closed defect (invalid)

MACOSX: Compile fails with text-console

Reported by: SF/mthreepwood Owned by: fingolfin
Priority: normal Component: Port: Mac OS X
Version: Keywords: build
Cc: Game:

Description

Mac OS X 10.5 (x86), XCode 3.1.2, gcc 4.0.1

When compiling with --enable-text-console, I get:

gui/debugger.cpp: In member function ‘void GUI::Debugger::enter()’: gui/debugger.cpp:159: error: invalid conversion from ‘char* (*)(const char*, int)’ to ‘int (*)(const char*, int)’ gui/debugger.cpp: In member function ‘bool GUI::Debugger::Cmd_Help(int, const char**)’: gui/debugger.cpp:419: error: ‘rl_get_screen_size’ was not declared in this scope

Ticket imported from: #2947577. Ticket imported from: bugs/4763.

Change History (4)

comment:1 by wjp, 14 years ago

It seems the reason for this is that libedit's readline is slightly different from GNU readline. The type of rl_completion_entry_function is an int-returning function, while in GNU readline it's a char*-returning function. (Interestingly, in libedit internally rl_completion_entry_function is explicitly cast back to a char*-returning function, so I hope our callback function can remain the same.)

The missing rl_get_screen_size appears to have been added in a newer version of libedit.

comment:2 by fingolfin, 14 years ago

On my Mac OS X 10.5, I don't get this error, because I have GNU readline installed (via Fink). Disabling that, I can replicate the error.

Nevertheless, I don't consider it a bug: We advertise --enable-text-console as enabling support for (GNU) readline. If more libs are compatible, great, but if they aren't, well, so it is. In this case, the OS X 10.5 version of libedit is missing one API, and has what looks like a bug in another one. Tough luck, but not our fault, and easily remedied by installing GNU readline via Fink, MacPort, or some other means.

That said, I wouldn't turn down a well-written patch which adds support for libs beyond GNU readline. Such as the libedit version shipped in Mac OS X :). Maybe even via its native API, instead of its readline wrapper... ?

comment:3 by fingolfin, 14 years ago

Owner: set to fingolfin
Resolution: invalid
Status: newclosed

comment:4 by digitall, 5 years ago

Component: Port: Mac OS X
Note: See TracTickets for help on using tickets.