Add EMSCRIPTEN checks

This commit is contained in:
Luke Street 2022-08-03 18:11:08 -04:00
parent 32090b4d4a
commit 4f3fbc0d0d
2 changed files with 3 additions and 3 deletions

View File

@ -47,7 +47,7 @@ if(WIN32)
target_sources(kabufuda PRIVATE target_sources(kabufuda PRIVATE
lib/kabufuda/AsyncIOWin32.cpp lib/kabufuda/AsyncIOWin32.cpp
) )
elseif(NX) elseif(NX OR EMSCRIPTEN)
target_sources(kabufuda PRIVATE target_sources(kabufuda PRIVATE
lib/kabufuda/AsyncIONX.cpp lib/kabufuda/AsyncIONX.cpp
) )

View File

@ -23,7 +23,7 @@ struct AsyncIOInner;
#endif #endif
class AsyncIO { class AsyncIO {
#ifdef __SWITCH__ #if defined(__SWITCH__) || defined(EMSCRIPTEN)
FILE* m_fd; FILE* m_fd;
#elif !defined(_WIN32) #elif !defined(_WIN32)
int m_fd = -1; int m_fd = -1;
@ -48,7 +48,7 @@ public:
ECardResult pollStatus(size_t qIdx, SizeReturn* szRet = nullptr) const; ECardResult pollStatus(size_t qIdx, SizeReturn* szRet = nullptr) const;
ECardResult pollStatus() const; ECardResult pollStatus() const;
void waitForCompletion() const; void waitForCompletion() const;
#ifdef __SWITCH__ #if defined(__SWITCH__) || defined(EMSCRIPTEN)
explicit operator bool() const { return m_fd != nullptr; } explicit operator bool() const { return m_fd != nullptr; }
#elif !defined(_WIN32) #elif !defined(_WIN32)
explicit operator bool() const { return m_fd != -1; } explicit operator bool() const { return m_fd != -1; }