You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

hacks.cpp 1.0 KiB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. //
  2. // Lol Engine
  3. //
  4. // Copyright © 2010—2015 Sam Hocevar <sam@hocevar.net>
  5. //
  6. // Lol Engine is free software. It comes without any warranty, to
  7. // the extent permitted by applicable law. You can redistribute it
  8. // and/or modify it under the terms of the Do What the Fuck You Want
  9. // to Public License, Version 2, as published by the WTFPL Task Force.
  10. // See http://www.wtfpl.net/ for more details.
  11. //
  12. #include <lol/engine-internal.h>
  13. /*
  14. * VS 2015 hack: the CRT was fully rewritten, and functions such
  15. * as _iob_func() and fprintf() have disappeared. Since we link with
  16. * libSDL which uses these versions, we need to provide them.
  17. */
  18. #if _MSC_VER >= 1900
  19. #include <cstdio>
  20. extern "C" {
  21. #if _M_X64
  22. void *__imp___iob_func(void)
  23. #else
  24. void *_imp____iob_func(void)
  25. #endif
  26. {
  27. return NULL;
  28. }
  29. #if _M_X64
  30. int __imp_fprintf(FILE *stream, char const *fmt, ...)
  31. #else
  32. int _imp__fprintf(FILE *stream, char const *fmt, ...)
  33. #endif
  34. {
  35. va_list va;
  36. va_start(va, fmt);
  37. int ret = vfprintf(stream, fmt, va);
  38. va_end(va);
  39. return ret;
  40. }
  41. }
  42. #endif