Compare commits
2 Commits
ce20282be0
...
3fbb2a0086
Author | SHA1 | Date | |
---|---|---|---|
3fbb2a0086 | |||
59c11e5309 |
3
deps/ox/src/ox/CMakeLists.txt
vendored
3
deps/ox/src/ox/CMakeLists.txt
vendored
@ -1,3 +1,6 @@
|
||||
if(${CMAKE_SYSTEM_NAME} STREQUAL "Windows")
|
||||
set(OX_OS_WINDOWS TRUE)
|
||||
endif()
|
||||
if(${CMAKE_SYSTEM_NAME} STREQUAL "FreeBSD")
|
||||
set(OX_OS_FREEBSD TRUE)
|
||||
else()
|
||||
|
1
deps/ox/src/ox/logconn/CMakeLists.txt
vendored
1
deps/ox/src/ox/logconn/CMakeLists.txt
vendored
@ -21,6 +21,7 @@ target_link_libraries(
|
||||
OxStd
|
||||
OxMetalClaw
|
||||
$<$<BOOL:${OX_OS_FREEBSD}>:pthread>
|
||||
$<$<BOOL:${OX_OS_WINDOWS}>:ws2_32>
|
||||
)
|
||||
|
||||
install(
|
||||
|
20
deps/ox/src/ox/logconn/logconn.cpp
vendored
20
deps/ox/src/ox/logconn/logconn.cpp
vendored
@ -9,22 +9,36 @@
|
||||
#ifdef OX_USE_STDLIB
|
||||
#include <cstdio>
|
||||
|
||||
#include <sys/types.h>
|
||||
#ifndef _WIN32
|
||||
#include <sys/socket.h>
|
||||
#include <arpa/inet.h>
|
||||
#include <netinet/in.h>
|
||||
#include <unistd.h>
|
||||
#else
|
||||
#include <winsock.h>
|
||||
#undef interface
|
||||
#undef min
|
||||
#undef max
|
||||
#endif
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <ox/std/bit.hpp>
|
||||
|
||||
#include "logconn.hpp"
|
||||
|
||||
#include <ox/std/bit.hpp>
|
||||
|
||||
namespace ox {
|
||||
|
||||
using namespace trace;
|
||||
|
||||
void closeSock(auto s) noexcept {
|
||||
#ifdef _WIN32
|
||||
closesocket(s);
|
||||
#else
|
||||
close(s);
|
||||
#endif
|
||||
}
|
||||
|
||||
LoggerConn::LoggerConn() noexcept: m_netThread([this]{this->msgSend();}) {
|
||||
}
|
||||
|
||||
@ -33,7 +47,7 @@ LoggerConn::~LoggerConn() noexcept {
|
||||
m_waitCond.notify_one();
|
||||
m_netThread.join();
|
||||
if (m_socket) {
|
||||
close(m_socket);
|
||||
closeSock(m_socket);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
add_executable(
|
||||
nostalgia
|
||||
nostalgia WIN32
|
||||
app.cpp
|
||||
main.cpp
|
||||
)
|
||||
|
@ -26,7 +26,11 @@ static ox::Error run(int argc, const char **argv) noexcept {
|
||||
return run(std::move(fs));
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
int WinMain(int argc, const char **argv) {
|
||||
#else
|
||||
int main(int argc, const char **argv) {
|
||||
#endif
|
||||
#if defined(DEBUG) && !defined(OX_BARE_METAL)
|
||||
ox::LoggerConn loggerConn;
|
||||
const auto loggerErr = loggerConn.initConn("Nostalgia Player");
|
||||
|
@ -1,7 +1,7 @@
|
||||
set(CMAKE_INCLUDE_CURRENT_DIR ON)
|
||||
|
||||
add_executable(
|
||||
nostalgia-studio MACOSX_BUNDLE
|
||||
nostalgia-studio WIN32 MACOSX_BUNDLE
|
||||
main.cpp
|
||||
)
|
||||
|
||||
|
@ -7,7 +7,11 @@
|
||||
|
||||
#include <studioapp/studioapp.hpp>
|
||||
|
||||
#ifdef _WIN32
|
||||
int WinMain(int argc, const char **argv) {
|
||||
#else
|
||||
int main(int argc, const char **argv) {
|
||||
#endif
|
||||
nostalgia::registerKeelModules();
|
||||
nostalgia::registerStudioModules();
|
||||
return studio::main("Nostalgia Studio", ".nostalgia", argc, argv);
|
||||
|
Loading…
x
Reference in New Issue
Block a user