diff options
| author | 3gg <3gg@shellblade.net> | 2025-12-27 12:03:39 -0800 |
|---|---|---|
| committer | 3gg <3gg@shellblade.net> | 2025-12-27 12:03:39 -0800 |
| commit | 5a079a2d114f96d4847d1ee305d5b7c16eeec50e (patch) | |
| tree | 8926ab44f168acf787d8e19608857b3af0f82758 /contrib/SDL-3.2.8/src/hidapi/SDL_hidapi_windows.h | |
Initial commit
Diffstat (limited to 'contrib/SDL-3.2.8/src/hidapi/SDL_hidapi_windows.h')
| -rw-r--r-- | contrib/SDL-3.2.8/src/hidapi/SDL_hidapi_windows.h | 82 |
1 files changed, 82 insertions, 0 deletions
diff --git a/contrib/SDL-3.2.8/src/hidapi/SDL_hidapi_windows.h b/contrib/SDL-3.2.8/src/hidapi/SDL_hidapi_windows.h new file mode 100644 index 0000000..c29122b --- /dev/null +++ b/contrib/SDL-3.2.8/src/hidapi/SDL_hidapi_windows.h | |||
| @@ -0,0 +1,82 @@ | |||
| 1 | /* | ||
| 2 | Simple DirectMedia Layer | ||
| 3 | Copyright (C) 1997-2025 Sam Lantinga <slouken@libsdl.org> | ||
| 4 | |||
| 5 | This software is provided 'as-is', without any express or implied | ||
| 6 | warranty. In no event will the authors be held liable for any damages | ||
| 7 | arising from the use of this software. | ||
| 8 | |||
| 9 | Permission is granted to anyone to use this software for any purpose, | ||
| 10 | including commercial applications, and to alter it and redistribute it | ||
| 11 | freely, subject to the following restrictions: | ||
| 12 | |||
| 13 | 1. The origin of this software must not be misrepresented; you must not | ||
| 14 | claim that you wrote the original software. If you use this software | ||
| 15 | in a product, an acknowledgment in the product documentation would be | ||
| 16 | appreciated but is not required. | ||
| 17 | 2. Altered source versions must be plainly marked as such, and must not be | ||
| 18 | misrepresented as being the original software. | ||
| 19 | 3. This notice may not be removed or altered from any source distribution. | ||
| 20 | */ | ||
| 21 | |||
| 22 | /* Define standard library functions in terms of SDL */ | ||
| 23 | |||
| 24 | /* #pragma push_macro/pop_macro works correctly only as of gcc >= 4.4.3 | ||
| 25 | clang-3.0 _seems_ to be OK. */ | ||
| 26 | #pragma push_macro("calloc") | ||
| 27 | #pragma push_macro("free") | ||
| 28 | #pragma push_macro("malloc") | ||
| 29 | #pragma push_macro("memcmp") | ||
| 30 | #pragma push_macro("swprintf") | ||
| 31 | #pragma push_macro("towupper") | ||
| 32 | #pragma push_macro("wcscmp") | ||
| 33 | #pragma push_macro("_wcsdup") | ||
| 34 | #pragma push_macro("wcslen") | ||
| 35 | #pragma push_macro("wcsncpy") | ||
| 36 | #pragma push_macro("wcsstr") | ||
| 37 | #pragma push_macro("wcstol") | ||
| 38 | |||
| 39 | #undef calloc | ||
| 40 | #undef free | ||
| 41 | #undef malloc | ||
| 42 | #undef memcmp | ||
| 43 | #undef swprintf | ||
| 44 | #undef towupper | ||
| 45 | #undef wcscmp | ||
| 46 | #undef _wcsdup | ||
| 47 | #undef wcslen | ||
| 48 | #undef wcsncpy | ||
| 49 | #undef wcsstr | ||
| 50 | #undef wcstol | ||
| 51 | |||
| 52 | #define calloc SDL_calloc | ||
| 53 | #define free SDL_free | ||
| 54 | #define malloc SDL_malloc | ||
| 55 | #define memcmp SDL_memcmp | ||
| 56 | #define swprintf SDL_swprintf | ||
| 57 | #define towupper (wchar_t)SDL_toupper | ||
| 58 | #define wcscmp SDL_wcscmp | ||
| 59 | #define _wcsdup SDL_wcsdup | ||
| 60 | #define wcslen SDL_wcslen | ||
| 61 | #define wcsncpy SDL_wcslcpy | ||
| 62 | #define wcsstr SDL_wcsstr | ||
| 63 | #define wcstol SDL_wcstol | ||
| 64 | |||
| 65 | #undef HIDAPI_H__ | ||
| 66 | #include "windows/hid.c" | ||
| 67 | #define HAVE_PLATFORM_BACKEND 1 | ||
| 68 | #define udev_ctx 1 | ||
| 69 | |||
| 70 | /* restore libc function macros */ | ||
| 71 | #pragma pop_macro("calloc") | ||
| 72 | #pragma pop_macro("free") | ||
| 73 | #pragma pop_macro("malloc") | ||
| 74 | #pragma pop_macro("memcmp") | ||
| 75 | #pragma pop_macro("swprintf") | ||
| 76 | #pragma pop_macro("towupper") | ||
| 77 | #pragma pop_macro("wcscmp") | ||
| 78 | #pragma pop_macro("_wcsdup") | ||
| 79 | #pragma pop_macro("wcslen") | ||
| 80 | #pragma pop_macro("wcsncpy") | ||
| 81 | #pragma pop_macro("wcsstr") | ||
| 82 | #pragma pop_macro("wcstol") | ||
