Work on fixing windows amalgamated build.

This commit is contained in:
Relintai 2024-01-19 13:43:08 +00:00
parent c421ae5f04
commit 4006d9ce01
6 changed files with 31 additions and 10 deletions

View File

@ -48,6 +48,8 @@ ccache g++ -Wall -D_REENTRANT -g -Isfw -c sfw/core/thread.cpp -o sfw/core/thread
ccache g++ -Wall -D_REENTRANT -g -Isfw -c sfw/core/socket.cpp -o sfw/core/socket.o
ccache g++ -Wall -D_REENTRANT -g -Isfw -c sfw/core/inet_address.cpp -o sfw/core/inet_address.o
ccache g++ -Wall -D_REENTRANT -g -Isfw -c sfw/core/sub_process.cpp -o sfw/core/sub_process.o
ccache g++ -Wall -D_REENTRANT -g -Isfw -c sfw/core/sfw_core.cpp -o sfw/core/sfw_core.o
ccache g++ -Wall -D_REENTRANT -g -Isfw -c sfw/object/object.cpp -o sfw/object/object.o
@ -116,6 +118,7 @@ ccache g++ -Wall \
sfw/core/pool_vector.o sfw/core/pool_allocator.o sfw/core/mutex.o sfw/core/sfw_time.o \
sfw/core/dir_access.o sfw/core/file_access.o sfw/core/thread.o \
sfw/core/socket.o sfw/core/inet_address.o \
sfw/core/sub_process.o \
sfw/core/sfw_core.o \
sfw/object/object.o sfw/object/reference.o sfw/object/core_string_names.o \
sfw/object/variant.o sfw/object/variant_op.o sfw/object/psignal.o \

View File

@ -114,10 +114,6 @@ AABB AABB::intersection(const AABB &p_aabb) const {
return AABB(min, max - min);
}
// MSVC
#undef near
#undef far
bool AABB::intersects_ray(const Vector3 &p_from, const Vector3 &p_dir, Vector3 *r_clip, Vector3 *r_normal) const {
Vector3 c1, c2;
Vector3 end = position + size;

View File

@ -25,6 +25,9 @@
#include "core/local_vector.h"
//--STRIP
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
typedef struct tagLOGCONTEXTW {
WCHAR lcName[40];
UINT lcOptions;

View File

@ -7,14 +7,17 @@
#include <stdio.h>
#include <stdlib.h>
#include <cstring>
#include <sys/time.h>
#include <time.h>
#include <unistd.h>
#include <ctime>
#include <wchar.h>
#include <cstdint>
#include <memory.h>
#if !defined(_WIN64) && !defined(_WIN32)
#include <sys/time.h>
#include <unistd.h>
#endif
#ifndef SFW_H
#include "sfw.h"
#endif

View File

@ -8,14 +8,17 @@
#include <stdio.h>
#include <stdlib.h>
#include <cstring>
#include <sys/time.h>
#include <time.h>
#include <unistd.h>
#include <ctime>
#include <wchar.h>
#include <cstdint>
#include <memory.h>
#if !defined(_WIN64) && !defined(_WIN32)
#include <sys/time.h>
#include <unistd.h>
#endif
#ifndef SFW_H
#ifdef __APPLE__
@ -44,9 +47,22 @@
#define Font The_Font_I_dont_care
#endif
// Note: On Windows we need to make sure that
// GLFW includes it's needed windows headers first, as it has quite a bit of setup.
// Also windows headers can define quite a bit of stuff like far and near macros
// Wee need to make sure it's safe to undo those as soon as possible
// This means that <windows.h> cannot be included in sfw.h if rendering is enabled.
// Also since it pull in lots of defines it probably shouldn't anyway.
#undef ONLY_GLAD
#include "sfw_3rd.m"
#if defined(_WIN64) || defined(_WIN32)
#undef far
#undef near
#undef FAR
#undef NEAR
#endif
#undef CursorShape
#if defined(__linux__)
@ -414,7 +430,7 @@
//#include <shlobj.h>
//#include <wchar.h>
//--STRIP
{{FILE:sfw/core/sub_process.cpp}}
//{//{FILE:sfw/core/sub_process.cpp}}
//--STRIP
//#include "core/pool_vector.h"

View File

@ -443,7 +443,7 @@
//Win Only
//#include "core/local_vector.h"
//--STRIP
{{FILE:sfw/core/sub_process.h}}
//{//{FILE:sfw/core/sub_process.h}}
//--STRIP
//no includes