mirror of
https://github.com/raysan5/raylib.git
synced 2025-12-14 18:35:31 +00:00
C++ compiler support v2 (#5252)
* Get C++ compilers working * Fix Formatting
This commit is contained in:
10
src/rcore.c
10
src/rcore.c
@@ -164,11 +164,17 @@
|
||||
#if (defined(_WIN32) && !defined(PLATFORM_DESKTOP_RGFW)) || (defined(_MSC_VER) && defined(PLATFORM_DESKTOP_RGFW))
|
||||
|
||||
struct HINSTANCE__;
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
__declspec(dllimport) unsigned long __stdcall GetModuleFileNameA(struct HINSTANCE__ *hModule, char *lpFilename, unsigned long nSize);
|
||||
__declspec(dllimport) unsigned long __stdcall GetModuleFileNameW(struct HINSTANCE__ *hModule, wchar_t *lpFilename, unsigned long nSize);
|
||||
__declspec(dllimport) int __stdcall WideCharToMultiByte(unsigned int cp, unsigned long flags, const wchar_t *widestr, int cchwide, char *str, int cbmb, const char *defchar, int *used_default);
|
||||
__declspec(dllimport) unsigned int __stdcall timeBeginPeriod(unsigned int uPeriod);
|
||||
__declspec(dllimport) unsigned int __stdcall timeEndPeriod(unsigned int uPeriod);
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
#elif defined(__linux__)
|
||||
#include <unistd.h>
|
||||
#elif defined(__FreeBSD__)
|
||||
@@ -2328,8 +2334,8 @@ const char *GetApplicationDirectory(void)
|
||||
int len = 0;
|
||||
#if defined(UNICODE)
|
||||
unsigned short widePath[MAX_PATH];
|
||||
len = GetModuleFileNameW(NULL, widePath, MAX_PATH);
|
||||
len = WideCharToMultiByte(0, 0, widePath, len, appDir, MAX_PATH, NULL, NULL);
|
||||
len = GetModuleFileNameW(NULL, (wchar_t *)widePath, MAX_PATH);
|
||||
len = WideCharToMultiByte(0, 0, (wchar_t *)widePath, len, appDir, MAX_PATH, NULL, NULL);
|
||||
#else
|
||||
len = GetModuleFileNameA(NULL, appDir, MAX_PATH);
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user