mirror of
https://github.com/zhigang1992/RubyMotion.git
synced 2026-04-26 13:55:44 +08:00
sim and deploy should work on Snow Leopard
This commit is contained in:
31
bin/sim.m
31
bin/sim.m
@@ -131,6 +131,37 @@ current_repl_prompt(id delegate, NSString *top_level)
|
||||
top_level, question];
|
||||
}
|
||||
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1060
|
||||
// This readline function is not implemented in Snow Leopard.
|
||||
// Code copied from http://cvsweb.netbsd.org/bsdweb.cgi/src/lib/libedit/readline.c?only_with_tag=MAIN
|
||||
#if !defined(RL_PROMPT_START_IGNORE)
|
||||
# define RL_PROMPT_START_IGNORE '\1'
|
||||
#endif
|
||||
#if !defined(RL_PROMPT_END_IGNORE)
|
||||
# define RL_PROMPT_END_IGNORE '\2'
|
||||
#endif
|
||||
int
|
||||
rl_set_prompt(const char *prompt)
|
||||
{
|
||||
char *p;
|
||||
|
||||
if (!prompt)
|
||||
prompt = "";
|
||||
if (rl_prompt != NULL && strcmp(rl_prompt, prompt) == 0)
|
||||
return 0;
|
||||
if (rl_prompt)
|
||||
/*el_*/free(rl_prompt);
|
||||
rl_prompt = strdup(prompt);
|
||||
if (rl_prompt == NULL)
|
||||
return -1;
|
||||
|
||||
while ((p = strchr(rl_prompt, RL_PROMPT_END_IGNORE)) != NULL)
|
||||
*p = RL_PROMPT_START_IGNORE;
|
||||
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void
|
||||
refresh_repl_prompt(id delegate, NSString *top_level, bool clear)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user