1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-06 19:50:22 +00:00

Simplify #include

Solving #119
This commit is contained in:
Roland Heyder 2022-11-27 00:11:04 +01:00
parent 28dc80b551
commit ec6e648007
2 changed files with 9 additions and 74 deletions

View file

@ -1291,13 +1291,8 @@ inline uint16 varseg_dblock_check(uint8 *off) {
}
}
#ifdef QB64_WINDOWS
#include "..\\temp\\global.txt"
#include "..\\temp\\regsf.txt"
#else
#include "../temp/global.txt"
#include "../temp/regsf.txt"
#endif
extern int32 ScreenResize;
extern int32 ScreenResizeScale;
@ -1306,21 +1301,13 @@ extern int32 ScreenResizeScale;
// main() begins, to set global, static variables
// controlling app init
void set_dynamic_info() {
#ifdef QB64_WINDOWS
#include "..\\temp\\dyninfo.txt"
#else
#include "../temp/dyninfo.txt"
#endif
}
void sub_clear(int32 ignore, int32 ignore2, int32 stack, int32 passed) {
static ptrszint tmp_long;
// note: stack can be ignored
#ifdef QB64_WINDOWS
#include "..\\temp\\clear.txt"
#else
#include "../temp/clear.txt"
#endif
// reset DATA read offset
data_offset = 0;
// close open files
@ -1399,11 +1386,7 @@ void chain_input() {
sub_get(FF, NULL, byte_element((uint64)&int32val, 4), 0);
// read COMMON data
#ifdef QB64_WINDOWS
#include "..\\temp\\inpchain.txt"
#else
#include "../temp/inpchain.txt"
#endif
sub_close(FF, 1);
@ -1614,11 +1597,7 @@ extensions_ready:
chain_savescreenstate(FF);
#ifdef QB64_WINDOWS
#include "..\\temp\\chain.txt"
#else
#include "../temp/chain.txt"
#endif
// add "end of commands" value
int32val = 0;
sub_put(FF, NULL, byte_element((uint64)&int32val, 4), 0);
@ -2340,11 +2319,7 @@ onstrig_recheck:
x = onstrig[(di << 8) + i].id;
i64 = onstrig[(di << 8) + i].pass;
switch (x) {
#ifdef QB64_WINDOWS
#include "..\\temp\\onstrig.txt"
#else
#include "../temp/onstrig.txt"
#endif
// example.....
// case 1:
//...
@ -2379,11 +2354,7 @@ onkey_recheck:
x = onkey[i].id;
i64 = onkey[i].pass;
switch (x) {
#ifdef QB64_WINDOWS
#include "..\\temp\\onkey.txt"
#else
#include "../temp/onkey.txt"
#endif
// example.....
// case 1:
//...
@ -2412,17 +2383,11 @@ onkey_recheck:
x = ontimer[i].id;
i64 = ontimer[i].pass;
switch (x) {
#ifdef QB64_WINDOWS
#include "..\\temp\\ontimer.txt"
#else
#include "../temp/ontimer.txt"
#endif
// example.....
// case 1:
//...
// break;
// example.....
// case 1:
//...
// break;
default:
break;
} // switch
@ -2526,25 +2491,6 @@ void QBMAIN(void *unused) {
sf_mem_lock->type = 3;
}
#ifdef QB64_WINDOWS
#include "..\\temp\\maindata.txt"
#include "..\\temp\\mainerr.txt"
#include "..\\temp\\runline.txt"
if (timer_event_occurred) {
timer_event_occurred--;
#include "..\\temp\\ontimerj.txt"
}
if (key_event_occurred) {
key_event_occurred--;
#include "..\\temp\\onkeyj.txt"
}
if (strig_event_occurred) {
strig_event_occurred--;
#include "..\\temp\\onstrigj.txt"
}
chain_input();
#include "..\\temp\\main.txt"
#else
#include "../temp/maindata.txt"
#include "../temp/mainerr.txt"
#include "../temp/runline.txt"
@ -2562,6 +2508,5 @@ void QBMAIN(void *unused) {
}
chain_input();
#include "../temp/main.txt"
#endif
//} (closed by main.txt)

View file

@ -4804,21 +4804,11 @@ DO
END IF 'dynamiclibrary
IF LEN(headername$) THEN
IF os$ = "WIN" THEN
IF MID$(headername$, 2, 1) = ":" OR LEFT$(headername$, 1) = "\" THEN
WriteBufLine RegTxtBuf, "#include " + CHR$(34) + headername$ + CHR$(34)
ELSE
WriteBufLine RegTxtBuf, "#include " + CHR$(34) + "..\\..\\" + headername$ + CHR$(34)
END IF
END IF
IF os$ = "LNX" THEN
IF LEFT$(headername$, 1) = "/" THEN
WriteBufLine RegTxtBuf, "#include " + CHR$(34) + headername$ + CHR$(34)
ELSE
WriteBufLine RegTxtBuf, "#include " + CHR$(34) + "../../" + headername$ + CHR$(34)
END IF
IF (os$ = "WIN" AND (MID$(headername$, 2, 1) = ":" OR LEFT$(headername$, 1) = "\")) _
OR (os$ = "LNX" AND (LEFT$(headername$, 1) = "/")) THEN
WriteBufLine RegTxtBuf, "#include " + CHR$(34) + headername$ + CHR$(34)
ELSE
WriteBufLine RegTxtBuf, "#include " + CHR$(34) + "../../" + headername$ + CHR$(34)
END IF
END IF