Skip to content

VERY experimental Nintendo Switch 2 emulator

C++

Fix merge conflicts

darkf8ba9ac0f74ab
diff --cc src/citra/CMakeLists.txt
index c4cbf9feab,b06259f5e1..0e03212d7f
--- a/src/citra/CMakeLists.txt
+++ b/src/citra/CMakeLists.txt
@@@ -12,25 -12,20 +12,23 @@@ set(HEADER
create_directory_groups(${SRCS} ${HEADERS})
- # NOTE: This is a workaround for CMake bug 0006976 (missing X11_xf86vmode_LIB variable)
- if (NOT X11_xf86vmode_LIB)
- set(X11_xv86vmode_LIB Xxf86vm)
- endif()
-
add_executable(citra ${SRCS} ${HEADERS})
target_link_libraries(citra core common video_core)
-target_link_libraries(citra ${OPENGL_gl_LIBRARY} ${GLFW_LIBRARIES} inih)
+target_link_libraries(citra ${GLFW_LIBRARIES} ${OPENGL_gl_LIBRARY} inih)
+ if (UNIX)
+ target_link_libraries(citra -pthread)
+ endif()
+
if (APPLE)
- target_link_libraries(citra iconv pthread ${COREFOUNDATION_LIBRARY})
+ target_link_libraries(citra iconv ${COREFOUNDATION_LIBRARY})
elseif (WIN32)
target_link_libraries(citra winmm)
+ if (MINGW)
+ target_link_libraries(citra iconv)
+ endif()
else() # Unix
- target_link_libraries(citra pthread rt)
- target_link_libraries(citra ${X11_X11_LIB} ${X11_Xi_LIB} ${X11_Xcursor_LIB} ${X11_Xrandr_LIB} ${X11_xv86vmode_LIB})
+ target_link_libraries(citra rt)
endif()
#install(TARGETS citra RUNTIME DESTINATION ${bindir})
diff --cc src/common/common_funcs.h
index ddf3958cce,ca7abbea6e..c2750a63c8
--- a/src/common/common_funcs.h
+++ b/src/common/common_funcs.h
@@@ -72,7 -75,9 +75,9 @@@ inline u64 _rotr64(u64 x, unsigned int
return (x >> n) | (x << (64 - n));
}
-#else // WIN32
+#else // _MSC_VER
+ #include <locale.h>
+
// Function Cross-Compatibility
#define strcasecmp _stricmp
#define strncasecmp _strnicmp
diff --cc src/common/log.h
index 4c96ef0a63,96d97249fc..c6a0235520
--- a/src/common/log.h
+++ b/src/common/log.h
@@@ -4,107 -4,11 +4,11 @@@
#pragma once
- #ifndef LOGGING
- #define LOGGING
- #endif
-
- enum {
- OS_LEVEL, // Printed by the emulated operating system
- NOTICE_LEVEL, // VERY important information that is NOT errors. Like startup and OSReports.
- ERROR_LEVEL, // Critical errors
- WARNING_LEVEL, // Something is suspicious.
- INFO_LEVEL, // General information.
- DEBUG_LEVEL, // Detailed debugging - might make things slow.
- };
-
- namespace LogTypes
- {
-
- enum LOG_TYPE {
- ACTIONREPLAY,
- AUDIO,
- AUDIO_INTERFACE,
- BOOT,
- COMMANDPROCESSOR,
- COMMON,
- CONSOLE,
- CONFIG,
- DISCIO,
- FILEMON,
- DSPHLE,
- DSPLLE,
- DSP_MAIL,
- DSPINTERFACE,
- DVDINTERFACE,
- DYNA_REC,
- EXPANSIONINTERFACE,
- GDB_STUB,
- ARM11,
- GSP,
- OSHLE,
- MASTER_LOG,
- MEMMAP,
- MEMCARD_MANAGER,
- OSREPORT,
- PAD,
- PROCESSORINTERFACE,
- PIXELENGINE,
- SERIALINTERFACE,
- SP1,
- STREAMINGINTERFACE,
- VIDEO,
- VIDEOINTERFACE,
- LOADER,
- FILESYS,
- WII_IPC_DVD,
- WII_IPC_ES,
- WII_IPC_FILEIO,
- WII_IPC_HID,
- KERNEL,
- SVC,
- NDMA,
- HLE,
- RENDER,
- GPU,
- HW,
- TIME,
- NETPLAY,
- GUI,
-
- NUMBER_OF_LOGS // Must be last
- };
-
- // FIXME: should this be removed?
- enum LOG_LEVELS {
- LOS = OS_LEVEL,
- LNOTICE = NOTICE_LEVEL,
- LERROR = ERROR_LEVEL,
- LWARNING = WARNING_LEVEL,
- LINFO = INFO_LEVEL,
- LDEBUG = DEBUG_LEVEL,
- };
-
- #define LOGTYPES_LEVELS LogTypes::LOG_LEVELS
- #define LOGTYPES_TYPE LogTypes::LOG_TYPE
-
- } // namespace
-
- void GenericLog(LOGTYPES_LEVELS level, LOGTYPES_TYPE type, const char*file, int line,
- const char* function, const char* fmt, ...)
- #ifdef __GNUC__
- __attribute__((format(printf, 6, 7)))
- #endif
- ;
-
- #if defined LOGGING || defined _DEBUG || defined DEBUGFAST
- #define MAX_LOGLEVEL LDEBUG
- #else
- #ifndef MAX_LOGLEVEL
- #define MAX_LOGLEVEL LWARNING
- #endif // loglevel
- #endif // logging
+ #include "common/common_funcs.h"
+ #include "common/msg_handler.h"
+ #include "common/logging/log.h"
-#ifdef _WIN32
+#ifdef MSVC_VER
#ifndef __func__
#define __func__ __FUNCTION__
#endif
@@@ -148,8 -39,7 +39,8 @@@
#define _assert_(_a_) _dbg_assert_(MASTER_LOG, _a_)
+#ifndef GEKKO
- #ifdef MSVC_VER
+ #ifdef _WIN32
#define _assert_msg_(_t_, _a_, _fmt_, ...) \
if (!(_a_)) {\
if (!PanicYesNo(_fmt_, __VA_ARGS__)) {Crash();} \
@@@ -159,7 -49,4 +50,7 @@@
if (!(_a_)) {\
if (!PanicYesNo(_fmt_, ##__VA_ARGS__)) {Crash();} \
}
- #endif // MSVC_VER
-#endif // WIN32
++#endif // _WIN32
+#else // GEKKO
+#define _assert_msg_(_t_, _a_, _fmt_, ...)
- #endif
++#endif
diff --cc src/common/platform.h
index 7d123caa03,53d98fe74c..ce5550520f
--- a/src/common/platform.h
+++ b/src/common/platform.h
@@@ -80,9 -77,8 +80,9 @@@
inline struct tm* localtime_r(const time_t *clock, struct tm *result) {
if (localtime_s(result, clock) == 0)
return result;
- return NULL;
+ return nullptr;
}
+#endif
#else