mirror of
https://gitee.com/openharmony/third_party_libsnd
synced 2024-11-23 09:59:54 +00:00
tests/win32_ordinal_test.c : Fix calling of GetProcAddress with ordinal under win64.
This commit is contained in:
parent
f6ed5755a1
commit
7c08018650
@ -9,6 +9,9 @@
|
||||
* examples/sndfile-play.c
|
||||
Fix win64 issues.
|
||||
|
||||
* tests/win32_ordinal_test.c
|
||||
Fix calling of GetProcAddress with ordinal under win64.
|
||||
|
||||
2008-09-25 Erik de Castro Lopo <erikd AT mega-nerd DOT com>
|
||||
|
||||
* examples/*
|
||||
|
@ -64,7 +64,13 @@ test_ordinal (HMODULE hmod, const char * func_name, int ordinal)
|
||||
|
||||
print_test_name ("win32_ordinal_test", func_name) ;
|
||||
|
||||
ord = GetProcAddress (hmod, (LPSTR) ordinal) ;
|
||||
#if SIZEOF_VOIDP == 8
|
||||
#define LPCSTR_OF_ORDINAL(x) ((LPCSTR) ((int64_t) (x)))
|
||||
#else
|
||||
#define LPCSTR_OF_ORDINAL(x) ((LPCSTR) (x))
|
||||
#endif
|
||||
|
||||
ord = GetProcAddress (hmod, LPCSTR_OF_ORDINAL (ordinal)) ;
|
||||
if ((name = GetProcAddress (hmod, func_name)) == NULL)
|
||||
{ FormatMessage (FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError (),
|
||||
MAKELANGID (LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpmsg, 0, NULL) ;
|
||||
|
Loading…
Reference in New Issue
Block a user