summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorAudi Nugraha <[email protected]>2022-07-10 00:33:18 +0700
committerGitHub <[email protected]>2022-07-09 19:33:18 +0200
commitd1aabb39578790f064717715785c877dd88be3c8 (patch)
tree3e255d11964df8c24c3fd895e721e42e1b8031a4 /src
parent5842a6a399c60e6357c353b4c3e098b975e383d5 (diff)
downloadraylib-d1aabb39578790f064717715785c877dd88be3c8.tar.gz
raylib-d1aabb39578790f064717715785c877dd88be3c8.zip
Allow DLL creation using TCC (#2569)
* Fix Undefined Symbol `_ftelli64` * Add files via upload * Update raylib.h * Update raylib.h
Diffstat (limited to 'src')
-rw-r--r--src/Makefile12
-rw-r--r--src/raylib.h3
2 files changed, 12 insertions, 3 deletions
diff --git a/src/Makefile b/src/Makefile
index f6ca3394..a0520d6e 100644
--- a/src/Makefile
+++ b/src/Makefile
@@ -456,7 +456,9 @@ LDFLAGS = $(CUSTOM_LDFLAGS) -L. -L$(RAYLIB_RELEASE_PATH)
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),WINDOWS)
- LDFLAGS += -Wl,--out-implib,$(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME)dll.a
+ ifneq ($(CC), tcc)
+ LDFLAGS += -Wl,--out-implib,$(RAYLIB_RELEASE_PATH)/lib$(RAYLIB_LIB_NAME)dll.a
+ endif
endif
ifeq ($(PLATFORM_OS),OSX)
LDFLAGS += -compatibility_version $(RAYLIB_API_VERSION) -current_version $(RAYLIB_VERSION)
@@ -469,7 +471,7 @@ ifeq ($(PLATFORM),PLATFORM_DESKTOP)
endif
endif
ifeq ($(PLATFORM),PLATFORM_RPI)
- LDFLAGS += -Wl,-soname,lib$(RAYLIB_LIB_NAME).so.$(RAYLIB_API_VERSION) -L$(RPI_TOOLCHAIN_SYSROOT)/opt/vc/lib
+ LDFLAGS += -Wl,-soname,lib$(RAYLIB_LIB_NAME).so.$(RAYLIB_API_VERSION) -L$(RPI_TOOLCHAIN_SYSROOT)/opt/vc/lib
endif
ifeq ($(PLATFORM),PLATFORM_DRM)
LDFLAGS += -Wl,-soname,lib$(RAYLIB_LIB_NAME).so.$(RAYLIB_API_VERSION)
@@ -490,7 +492,11 @@ endif
#------------------------------------------------------------------------------------------------
ifeq ($(PLATFORM),PLATFORM_DESKTOP)
ifeq ($(PLATFORM_OS),WINDOWS)
- LDLIBS = -static-libgcc -lopengl32 -lgdi32 -lwinmm
+ ifeq ($(CC), tcc)
+ LDLIBS = -lopengl32 -lgdi32 -lwinmm -lshell32
+ else
+ LDLIBS = -static-libgcc -lopengl32 -lgdi32 -lwinmm
+ endif
endif
ifeq ($(PLATFORM_OS),LINUX)
LDLIBS = -lGL -lc -lm -lpthread -ldl -lrt
diff --git a/src/raylib.h b/src/raylib.h
index 04cfaaea..12aba4d9 100644
--- a/src/raylib.h
+++ b/src/raylib.h
@@ -86,6 +86,9 @@
// NOTE: Microsoft specifiers to tell compiler that symbols are imported/exported from a .dll
#if defined(_WIN32)
#if defined(BUILD_LIBTYPE_SHARED)
+ #if defined(__TINYC__)
+ #define __declspec(x) __attribute__((x))
+ #endif
#define RLAPI __declspec(dllexport) // We are building the library as a Win32 shared library (.dll)
#elif defined(USE_LIBTYPE_SHARED)
#define RLAPI __declspec(dllimport) // We are using the library as a Win32 shared library (.dll)