Browse Source

build: a few hacks to allow building with MinGW on Windows.

legacy
Sam Hocevar sam 12 years ago
parent
commit
85275834e2
2 changed files with 27 additions and 1 deletions
  1. +1
    -1
      build/lol-build
  2. +26
    -0
      tools/make-font.cpp

+ 1
- 1
build/lol-build View File

@@ -152,7 +152,7 @@ configure()
GTK_LIBS="$GTK_LIBS -lgtk-win32-2.0 -lgdk-win32-2.0"
GTK_LIBS="$GTK_LIBS -lglib-2.0 -lgthread-2.0 -lgobject-2.0"

CPPFLAGS="$CPPFLAGS -L$PWD/contrib/libcaca-0.99.beta18/include -DCACA_STATIC"
CPPFLAGS="$CPPFLAGS -I$PWD/contrib/libcaca-0.99.beta18/include -DCACA_STATIC"

PATH="$PATH" PKG_CONFIG_PATH="$PKG_CONFIG_PATH" ./configure $HOSTFLAGS $BUILDFLAGS CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" GTK_LIBS="$GTK_LIBS"
;;


+ 26
- 0
tools/make-font.cpp View File

@@ -12,6 +12,32 @@

#include <caca.h>

/* FIXME: ugly MinGW hack */
#if defined _WIN32 && defined __GNUC__
extern "C"
{
int sprintf_s(char *s, size_t n, const char *fmt, ...)
{
va_list args;
int ret;
va_start(args, fmt);
ret = vsnprintf(s, n, fmt, args);
va_end(args);
return ret;
}

int vsnprintf_s(char *s, size_t n, size_t c, const char *fmt, va_list args)
{
return vsnprintf(s, n, fmt, args);
}

int _time32(__time32_t *timer)
{
return 0;
}
}
#endif

int main(void)
{
caca_canvas_t *cv = caca_create_canvas(16, 16);


Loading…
Cancel
Save