Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 8 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -187,18 +187,16 @@ ifndef DISABLE_MMD
DEPFLAGS = -MMD -MP -MF $(@:.o=.d)
endif

FORCE:
# trigger configure re-run if $(CC) changes
_dummy := $(shell \
printf '$(CC)' > compat/tmp/cc-new; \
cmp -s compat/tmp/cc-new compat/tmp/cc || \
mv compat/tmp/cc-new compat/tmp/cc; \
rm -f compat/tmp/cc-new \
)

compat/config.mk: compat/configure.sh compat/tmp/cc
@$(MAKE) distclean > /dev/null
@CC="$(CC)" $(SHELL) compat/configure.sh
@$(MAKE)
@exit 0

compat/tmp/cc: FORCE
@printf '$(CC)' > compat/tmp/cc-new
@cmp -s compat/tmp/cc-new compat/tmp/cc || mv compat/tmp/cc-new compat/tmp/cc
@rm -f compat/tmp/cc-new

endif

Expand All @@ -213,4 +211,4 @@ clean:
rm -rf build

distclean: clean
rm -f compat/config.mk
rm -f compat/config.mk compat/tmp/cc
16 changes: 14 additions & 2 deletions compat/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ check 'if the C compiler works' || exit 1

printf 'checking if we are cross compiling: '
printf 'checking if we are cross compiling:\n' >> tmp/config.log
if tmp/a.out; then
if tmp/a.out > /dev/null 2>&1; then
printf 'no\n'
printf 'result: no\n' >> tmp/config.log
else
Expand All @@ -55,7 +55,7 @@ if check 'for librt' -lrt; then
fi

if check 'for libdl' -ldl; then
# sometimes needed for glad
# sometimes needed for glad or miniaudio
config 'LIBS += -ldl'
fi

Expand Down Expand Up @@ -92,4 +92,16 @@ if ! check 'if stdbool.h works'; then
config 'INCLUDES += -Icompat/stdbool'
fi

printf '%s' "\
#include <stdio.h>
int main(void){
puts(__func__);
return 0;
}
" > tmp/test.c

if ! check 'if __func__ works'; then
config 'DEFINES += -D__func__=\"unknown\"'
fi

rm -f tmp/test.c tmp/a.out
3 changes: 2 additions & 1 deletion src/rvalue.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ struct RValue {
GMLMethod* method;
#endif
Instance* structInst;
double _alignment_dont_use;
};
// We use uint8_t for the type instead of RValueType because a enum value occupies 4 bytes, while uint8_t occupies 1 byte
uint8_t type;
Expand All @@ -88,7 +89,7 @@ struct RValue {
bool ownsReference;
uint8_t gmlStackType; // GML data type from the instruction that pushed this value
uint8_t assetRefType; // For RVALUE_ASSETREF: Indicates the asset type (AssetRefType)
} __attribute__((aligned(8)));
};

static inline RValue RValue_makeReal(GMLReal val) {
RValue rv = {0};
Expand Down
2 changes: 1 addition & 1 deletion vendor/stb/ds/stb_ds.h
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ enum
STBDS_SH_ARENA
};

#ifdef __cplusplus
#if defined(__cplusplus) && (!defined(__GNUC__) || __GNUC__ >= 3 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8))
// in C we use implicit assignment from these void*-returning functions to T*.
// in C++ these templates make the same code work
template<class T> static T * stbds_arrgrowf_wrapper(T *a, size_t elemsize, size_t addlen, size_t min_cap) {
Expand Down
Loading