SDL_os2.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. /*
  2. Simple DirectMedia Layer
  3. Copyright (C) 1997-2022 Sam Lantinga <slouken@libsdl.org>
  4. This software is provided 'as-is', without any express or implied
  5. warranty. In no event will the authors be held liable for any damages
  6. arising from the use of this software.
  7. Permission is granted to anyone to use this software for any purpose,
  8. including commercial applications, and to alter it and redistribute it
  9. freely, subject to the following restrictions:
  10. 1. The origin of this software must not be misrepresented; you must not
  11. claim that you wrote the original software. If you use this software
  12. in a product, an acknowledgment in the product documentation would be
  13. appreciated but is not required.
  14. 2. Altered source versions must be plainly marked as such, and must not be
  15. misrepresented as being the original software.
  16. 3. This notice may not be removed or altered from any source distribution.
  17. */
  18. #ifndef SDL_os2_h_
  19. #define SDL_os2_h_
  20. #include "SDL_log.h"
  21. #include "SDL_stdinc.h"
  22. #ifdef OS2DEBUG
  23. #if (OS2DEBUG-0 >= 2)
  24. # define debug_os2(s,...) SDL_LogDebug(SDL_LOG_CATEGORY_APPLICATION, \
  25. __func__ "(): " ##s, ##__VA_ARGS__)
  26. #else
  27. # define debug_os2(s,...) printf(__func__ "(): " ##s "\n", ##__VA_ARGS__)
  28. #endif
  29. #else /* no debug */
  30. # define debug_os2(s,...) do {} while (0)
  31. #endif /* OS2DEBUG */
  32. #if defined(HAVE_ICONV) && defined(HAVE_ICONV_H)
  33. #define OS2_SysToUTF8(S) SDL_iconv_string("UTF-8", "", (char *)(S), SDL_strlen(S)+1)
  34. #define OS2_UTF8ToSys(S) SDL_iconv_string("", "UTF-8", (char *)(S), SDL_strlen(S)+1)
  35. #define libiconv_clean() do {} while(0)
  36. #else
  37. /* StrUTF8New() - geniconv/sys2utf8.c */
  38. #include "geniconv/geniconv.h"
  39. #define OS2_SysToUTF8(S) StrUTF8New(1, (S), SDL_strlen((S)) + 1)
  40. #define OS2_UTF8ToSys(S) StrUTF8New(0, (char *)(S), SDL_strlen((S)) + 1)
  41. #endif
  42. /* SDL_OS2Quit() will be called from SDL_QuitSubSystem() */
  43. void SDL_OS2Quit(void);
  44. #endif /* SDL_os2_h_ */
  45. /* vi: set ts=4 sw=4 expandtab: */