Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@

build/
# /
/cAudio.ncb
/cAudio.suo
Expand Down
8 changes: 8 additions & 0 deletions cAudio/include/cAudioString.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,11 @@ namespace cAudio
static char buffer[8][1024];
id = ++id & 0x7;

#ifdef CAUDIO_PLATFORM_WIN
int buff_size = WideCharToMultiByte(CP_UTF8, 0, reinterpret_cast<const wchar_t *>(str.c_str()), (int)(str.size() < 1023 ? str.size() : 1023), buffer[id], 1023, 0, reinterpret_cast<int *>(false));
#else
int buff_size = WideCharToMultiByte(CP_UTF8, 0, str.c_str(), (int)(str.size() < 1023 ? str.size() : 1023), buffer[id], 1023, 0, false);
#endif
buffer[id][buff_size] = 0;
buffer[id][1023] = 0;
return buffer[id];
Expand All @@ -61,7 +65,11 @@ namespace cAudio
int str_len = (int)strlen(str);
int buf_size = MultiByteToWideChar(CP_UTF8, 0, str, str_len, 0, 0);
cAudioString s(buf_size, L'\0');
#ifdef CAUDIO_PLATFORM_WIN
MultiByteToWideChar(CP_UTF8, 0, str, str_len, reinterpret_cast<wchar_t *>(s[0]), buf_size);
#else
MultiByteToWideChar(CP_UTF8, 0, str, str_len, &s[0], buf_size);
#endif
return s;
}

Expand Down
15 changes: 14 additions & 1 deletion cAudio/src/cThread.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@

#include "cThread.h"
#include "cAudioSleep.h"
#ifdef CAUDIO_PLATFORM_WIN
#include <excpt.h>
#endif

namespace cAudio
{
Expand Down Expand Up @@ -99,11 +102,21 @@ namespace cAudio
info.dwThreadID = dwThreadID;
info.dwFlags = 0;

__try
#ifdef CAUDIO_PLATFORM_WIN
try
#else
__try
#endif

{
RaiseException(MS_VC_EXCEPTION, 0, sizeof(info) / sizeof(ULONG_PTR), (ULONG_PTR*)&info);
}
#ifdef CAUDIO_PLATFORM_WIN
catch (bool b)
#else
__except (EXCEPTION_EXECUTE_HANDLER)
#endif

{
}
}
Expand Down