Core/CLI: Use proper define in platform checks

This commit is contained in:
Shauren
2011-03-08 17:44:28 +01:00
parent e25a5ca4f8
commit ca0adc6a75

View File

@@ -35,7 +35,7 @@
#include "Player.h"
#include "Util.h"
#if PLATFORM != WINDOWS
#if PLATFORM != PLATFORM_WINDOWS
#include <readline/readline.h>
#include <readline/history.h>
@@ -564,7 +564,7 @@ void CliRunnable::run()
{
///- Display the list of available CLI functions then beep
//sLog->outString("");
#if PLATFORM != WINDOWS
#if PLATFORM != PLATFORM_WINDOWS
rl_attempted_completion_function = cli_completion;
rl_event_hook = cli_hook_func;
#endif
@@ -582,9 +582,9 @@ void CliRunnable::run()
char *command_str ; // = fgets(commandbuf,sizeof(commandbuf),stdin);
#if PLATFORM == WINDOWS
#if PLATFORM == PLATFORM_WINDOWS
char commandbuf[256];
command_str = fgets(commandbuf,sizeof(commandbuf),stdin);
command_str = fgets(commandbuf, sizeof(commandbuf), stdin);
#else
command_str = readline("TC>");
rl_bind_key('\t',rl_complete);
@@ -609,14 +609,14 @@ void CliRunnable::run()
std::string command;
if (!consoleToUtf8(command_str,command)) // convert from console encoding to utf8
{
#if PLATFORM == WINDOWS
#if PLATFORM == PLATFORM_WINDOWS
printf("TC>");
#endif
continue;
}
fflush(stdout);
sWorld->QueueCliCommand(new CliCommandHolder(NULL, command.c_str(), &utf8print, &commandFinished));
#if PLATFORM != WINDOWS
#if PLATFORM != PLATFORM_WINDOWS
add_history(command.c_str());
#endif