Skip to content

Commit

Permalink
Fix compile error when compiling without WIN32_GUI due to defining a …
Browse files Browse the repository at this point in the history
…"printf" macro
  • Loading branch information
RElesgoe committed Aug 23, 2016
1 parent 159e078 commit 795964d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
7 changes: 5 additions & 2 deletions src/bnetd/cmdline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
#endif
#ifdef WIN32_GUI
# include "common/gui_printf.h"
# define printf gui_lvprintf
#endif
#include "compat/strcasecmp.h"
#include "common/eventlog.h"
Expand Down Expand Up @@ -255,7 +254,11 @@ namespace pvpgn

conf_set_bool(&tmp, valstr, 0);
if (tmp) {
printf(eventlog_level_info, PVPGN_SOFTWARE" version " PVPGN_VERSION "\n");
#ifdef WIN32_GUI
gui_lvprintf(eventlog_level_info, PVPGN_SOFTWARE" version " PVPGN_VERSION "\n");
#else
std::printf(PVPGN_SOFTWARE" version " PVPGN_VERSION "\n");
#endif
exitflag = 1;
}

Expand Down
22 changes: 15 additions & 7 deletions src/bnetd/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
#endif
#ifdef WIN32_GUI
# include "common/gui_printf.h"
# define printf gui_lvprintf
#endif

#include "compat/stdfileno.h"
Expand Down Expand Up @@ -503,12 +502,21 @@ void pvpgn_greeting()
eventlog(eventlog_level_info, __FUNCTION__, "uname() failed");
}

printf(eventlog_level_info, "You are currently running " PVPGN_SOFTWARE " " PVPGN_VERSION "\n");
printf(eventlog_level_info, "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n");
printf(eventlog_level_info, "If you need support:\n");
printf(eventlog_level_info, " * Create an issue at https://github.com/pvpgn/pvpgn-server\n");
printf(eventlog_level_info, "\nServer is now running.\n");
printf(eventlog_level_info, "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n");
#ifdef WIN32_GUI
gui_lvprintf(eventlog_level_info, "You are currently running " PVPGN_SOFTWARE " " PVPGN_VERSION "\n");
gui_lvprintf(eventlog_level_info, "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n");
gui_lvprintf(eventlog_level_info, "If you need support:\n");
gui_lvprintf(eventlog_level_info, " * Create an issue at https://github.com/pvpgn/pvpgn-server\n");
gui_lvprintf(eventlog_level_info, "\nServer is now running.\n");
gui_lvprintf(eventlog_level_info, "=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n");
#else
std::printf("You are currently running " PVPGN_SOFTWARE " " PVPGN_VERSION "\n");
std::printf("=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n");
std::printf("If you need support:\n");
std::printf(" * Create an issue at https://github.com/pvpgn/pvpgn-server\n");
std::printf("\nServer is now running.\n");
std::printf("=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=\n");
#endif

return;
}
Expand Down

0 comments on commit 795964d

Please sign in to comment.