Skip to content

Commit

Permalink
Fix build on linux-g++-64,
Browse files Browse the repository at this point in the history
fix russian letters in app logs.
  • Loading branch information
EXL committed Jan 25, 2014
1 parent 2c9bbc1 commit be95e42
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 14 deletions.
26 changes: 18 additions & 8 deletions common/stat.cpp
Expand Up @@ -4,6 +4,9 @@
#include <string.h>
#include <time.h>

#include <SDL/SDL.h>
#include "graphics/font.h"

#include "basics.h"
#include "misc.fdh"

Expand Down Expand Up @@ -38,18 +41,25 @@ void c------------------------------() {}

void stat(const char *fmt, ...)
{
va_list ar;
char buffer[MAXBUFSIZE];

va_list ar;
char buffer[MAXBUFSIZE];
va_start(ar, fmt);
vsnprintf(buffer, sizeof(buffer), fmt, ar);
va_end(ar);

puts(buffer);
fflush(stdout);

if (logfilename[0])
writelog(buffer, true);
#ifdef _L10N_CP1251
char buffer_w_u[MAXBUFSIZE];
NXFont::win1251_to_utf8(buffer, buffer_w_u);
puts(buffer_w_u);
fflush(stdout);
if (logfilename[0])
writelog(buffer_w_u, true);
#else
puts(buffer);
fflush(stdout);
if (logfilename[0])
writelog(buffer, true);
#endif
}

void staterr(const char *fmt, ...)
Expand Down
2 changes: 1 addition & 1 deletion graphics/font.h
Expand Up @@ -28,7 +28,7 @@ class NXFont
bool InitChars(TTF_Font *font, uint32_t color);
bool InitCharsShadowed(TTF_Font *top, uint32_t color, uint32_t shadowcolor);

int win1251_to_utf8(const char* text, char* utext);
static int win1251_to_utf8(const char* text, char* utext);

bool InitBitmapChars(SDL_Surface *sheet, uint32_t fgcolor, uint32_t color);
bool InitBitmapCharsShadowed(SDL_Surface *sheet, uint32_t fgcolor, uint32_t color, uint32_t shadowcolor);
Expand Down
10 changes: 5 additions & 5 deletions nx.pro
Expand Up @@ -29,7 +29,7 @@ CONFIG -= l10n_rus
linux-mips-g++: CONFIG += platform-rzx50

# Targets
win32-g++|linux-g++ {
win32-g++ | linux-g++ | linux-g++-64 {
TARGET = nx
} linux-mips-g++ {
TARGET = nx.dge
Expand All @@ -39,13 +39,13 @@ win32-g++|linux-g++ {

# Strip release binary
CONFIG(release, debug|release) {
linux-g++ | linux-mips-g++ | linux-arm-gnueabi-g++ {
linux-g++ | linux-g++-64 | linux-mips-g++ | linux-arm-gnueabi-g++ {
QMAKE_POST_LINK += $(STRIP) $(TARGET)
}
}

# Defines
win32-g++|linux-g++ {
win32-g++ | linux-g++ | linux-g++-64 {
DEFINES +=
} linux-mips-g++ {
CONFIG(platform-rzx50, platform-rzx50|platform-a320) {
Expand Down Expand Up @@ -84,7 +84,7 @@ INCLUDEPATH += .
win32-g++: {
INCLUDEPATH += C:/MinGW/include
INCLUDEPATH += C:/MinGW/include/SDL
} linux-g++ {
} linux-g++ | linux-g++-64 {
INCLUDEPATH += /usr/include
INCLUDEPATH += /usr/include/SDL
} linux-mips-g++ {
Expand All @@ -99,7 +99,7 @@ win32-g++: {
win32-g++ {
QMAKE_LFLAGS += -static -static-libgcc -static-libstdc++
LIBS += -lmingw32 -lSDL_ttf -lfreetype -lpng -lz -lSDLmain -lSDL -lgdi32 -lwinmm
} linux-g++ {
} linux-g++ | linux-g++-64 {
LIBS += -lSDLmain -lSDL -lSDL_ttf
} linux-mips-g++ {
LIBS += -lSDLmain -lSDL -lSDL_ttf -lSDL_mixer
Expand Down

0 comments on commit be95e42

Please sign in to comment.