mirror of
https://github.com/QB64Official/qb64.git
synced 2024-05-12 12:00:14 +00:00
Compare commits
18 commits
7092fc23fe
...
aa0e525b49
Author | SHA1 | Date | |
---|---|---|---|
aa0e525b49 | |||
a62074f27b | |||
c7fd3bb5d9 | |||
53784f5296 | |||
60d2234540 | |||
3cef4b4088 | |||
04957e9b85 | |||
04546ae979 | |||
7ad1aac065 | |||
60e3bc4581 | |||
ab386e04f1 | |||
97be38ec96 | |||
319fc322ee | |||
fcc61cc722 | |||
3fead708b4 | |||
24f1893c39 | |||
a568095ad0 | |||
bfb244cf50 |
10
findcurl.cmd
10
findcurl.cmd
|
@ -15,14 +15,18 @@ rem Check if curl exists
|
|||
curl --version 2>NUL 1>&2
|
||||
|
||||
|
||||
if %ERRORLEVEL == 9009 (
|
||||
if %ERRORLEVEL% == 9009 (
|
||||
rem check if we have it already
|
||||
if exist internal\curl\curl.exe goto gotcurl
|
||||
mkdir internal\curl >NUL
|
||||
echo Fetching %LINK%
|
||||
explorer %LINK%
|
||||
|
||||
rem we should wait until the file is downloaded, because explorer returns straight away
|
||||
:keeptesting
|
||||
rem sleep 5 - we need to find something that'll work on XP, as timeout doesn't exist
|
||||
rem if not exist "%USERPROFILE%\Desktop\%CURLVERSION%" goto keeptesting
|
||||
"%SystemRoot%\system32\expand.exe" "%USERPROFILE%\Desktop\%CURLVERSION%" /F:%ARCH%\* internal\curl
|
||||
|
||||
:gotcurl
|
||||
rem Add to path
|
||||
PATH=%PATH%;%~dp0\internal\curl
|
||||
) ELSE (
|
||||
|
|
|
@ -11555,12 +11555,19 @@ void qbg_sub_locate(int32 row,int32 column,int32 cursor,int32 start,int32 stop,i
|
|||
HANDLE output = GetStdHandle (STD_OUTPUT_HANDLE);
|
||||
SetConsoleCursorPosition(output, pos);
|
||||
#else
|
||||
// We don't have a good way of getting the current cursor position, so we ignore any LOCATEs
|
||||
// that don't give an absolute position.
|
||||
if (!(passed & 1 && passed & 2))
|
||||
if (passed & 1 && passed & 2){
|
||||
printf("\033[%d;%dH", row, column);
|
||||
return;
|
||||
printf("\033[%d;%dH", row, column);
|
||||
#endif
|
||||
}
|
||||
if (passed & 1){
|
||||
printf("\033[%dd", row);
|
||||
return;
|
||||
}
|
||||
if (passed & 2){
|
||||
printf("\033[%d;%dG", column);
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -19077,7 +19084,7 @@ void sub_put2(int32 i,int64 offset,void *element,int32 passed){
|
|||
if (new_error) return 0;
|
||||
|
||||
#ifdef QB64_WINDOWS
|
||||
if ((read_page->console && !passed)||i==console_image){
|
||||
if ((write_page->console && !passed)||i==console_image){
|
||||
SECURITY_ATTRIBUTES SecAttribs = {sizeof(SECURITY_ATTRIBUTES), 0, 1};
|
||||
HANDLE cl_conout = CreateFileA("CONOUT$", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, & SecAttribs, OPEN_EXISTING, 0, 0);
|
||||
CONSOLE_SCREEN_BUFFER_INFO cl_bufinfo;
|
||||
|
@ -19086,7 +19093,7 @@ void sub_put2(int32 i,int64 offset,void *element,int32 passed){
|
|||
}
|
||||
#endif
|
||||
#ifdef QB64_UNIX
|
||||
if ((read_page->console && !passed)||i==console_image){
|
||||
if ((write_page->console && !passed)||i==console_image){
|
||||
struct winsize w;
|
||||
ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
|
||||
return w.ws_col;
|
||||
|
@ -19113,7 +19120,7 @@ void sub_put2(int32 i,int64 offset,void *element,int32 passed){
|
|||
if (new_error) return 0;
|
||||
|
||||
#ifdef QB64_WINDOWS
|
||||
if ((read_page->console && !passed)||i==console_image){
|
||||
if ((write_page->console && !passed)||i==console_image){
|
||||
SECURITY_ATTRIBUTES SecAttribs = {sizeof(SECURITY_ATTRIBUTES), 0, 1};
|
||||
HANDLE cl_conout = CreateFileA("CONOUT$", GENERIC_READ | GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, & SecAttribs, OPEN_EXISTING, 0, 0);
|
||||
CONSOLE_SCREEN_BUFFER_INFO cl_bufinfo;
|
||||
|
@ -19123,7 +19130,7 @@ void sub_put2(int32 i,int64 offset,void *element,int32 passed){
|
|||
}
|
||||
#endif
|
||||
#ifdef QB64_UNIX
|
||||
if ((read_page->console && !passed)||i==console_image){
|
||||
if ((write_page->console && !passed)||i==console_image){
|
||||
struct winsize w;
|
||||
ioctl(STDOUT_FILENO, TIOCGWINSZ, &w);
|
||||
return w.ws_row;
|
||||
|
|
|
@ -1 +0,0 @@
|
|||
objcopy -Ibinary -Oelf32-i386 -Bi386
|
|
@ -1,3 +0,0 @@
|
|||
objcopy -Ibinary -Oelf64-x86-64 -Bi386:x86-64
|
||||
|
||||
|
|
@ -34,7 +34,7 @@
|
|||
#error "Unknown system; refusing to build. Edit os.h if needed"
|
||||
#endif
|
||||
|
||||
#if defined(_WIN64) || defined(__x86_64__) || defined(__ppc64__) || defined(QB64_MACOSX) || defined(__aarch64__)
|
||||
#if defined(_WIN64) || defined(__x86_64__) || defined(__ppc64__) || defined(__PPC64__) || defined(QB64_MACOSX) || defined(__aarch64__)
|
||||
#define QB64_64
|
||||
#else
|
||||
#define QB64_32
|
||||
|
|
|
@ -55,8 +55,12 @@ rem )
|
|||
reg Query "HKLM\Hardware\Description\System\CentralProcessor\0" | find /i "x86" > NUL && goto chose32 || goto choose
|
||||
|
||||
:choose
|
||||
choice /c 12 /M "Use (1) 64-bit or (2) 32-bit MINGW? "
|
||||
if errorlevel == 1 goto chose64
|
||||
if not exist %SystemRoot%\system32\choice.exe (
|
||||
set /p errorlevel="Install (1) 64-bit or (2) 32-bit MINGW? "
|
||||
) else (
|
||||
choice /c 12 /M "Install (1) 64-bit or (2) 32-bit MINGW? "
|
||||
)
|
||||
if errorlevel 1 goto chose64
|
||||
goto chose32
|
||||
|
||||
:chose32
|
||||
|
@ -74,18 +78,34 @@ goto chosen
|
|||
echo Downloading %url%...
|
||||
curl -L %url% -o temp.7z
|
||||
|
||||
echo Downloading 7zr.exe...
|
||||
curl -L https://www.7-zip.org/a/7zr.exe -o 7zr.exe
|
||||
echo Testing for 7zip
|
||||
7z >NUL 2>&1
|
||||
|
||||
echo Extracting C++ Compiler...
|
||||
7zr.exe x temp.7z -y
|
||||
if ERRORLEVEL 9009 (
|
||||
|
||||
echo Downloading 7zr.exe...
|
||||
rem Check for XP (either 32-bit or 64-bit)
|
||||
ver | findstr /R /C:"Version 5.[12]"
|
||||
if errorlevel 0 (
|
||||
curl -Lk https://www.7-zip.org/a/7zr.exe -o 7zr.exe
|
||||
) else (
|
||||
curl -L https://www.7-zip.org/a/7zr.exe -o 7zr.exe
|
||||
)
|
||||
|
||||
echo Extracting C++ Compiler...
|
||||
7zr.exe x temp.7z -y
|
||||
) else (
|
||||
echo Extracting C++ Compiler...
|
||||
7z x temp.7z -y
|
||||
)
|
||||
|
||||
echo Moving C++ compiler...
|
||||
for /f %%a in ('dir %MINGW% /b') do move /y "%MINGW%\%%a" internal\c\c_compiler\
|
||||
|
||||
echo Cleaning up..
|
||||
rd %MINGW%
|
||||
del 7zr.exe
|
||||
if exist 7zr.exe del 7zr.exe
|
||||
|
||||
del temp.7z
|
||||
|
||||
:skipccompsetup
|
||||
|
|
|
@ -13123,9 +13123,30 @@ IF os$ = "LNX" THEN
|
|||
|
||||
IF inline_DATA = 0 THEN
|
||||
IF DataOffset THEN
|
||||
IF INSTR(_OS$, "[32BIT]") THEN b$ = "32" ELSE b$ = "64"
|
||||
OPEN ".\internal\c\makedat_lnx" + b$ + ".txt" FOR BINARY AS #150: LINE INPUT #150, a$: CLOSE #150
|
||||
a$ = a$ + " " + tmpdir2$ + "data.bin " + tmpdir2$ + "data.o"
|
||||
SHELL _HIDE "ld --verbose >internal/temp/ld-output.txt"
|
||||
OPEN "internal/temp/ld-output.txt" FOR BINARY AS #150
|
||||
DO UNTIL EOF(150)
|
||||
LINE INPUT #150, a$
|
||||
IF LEN(a$) THEN
|
||||
s$ = "OUTPUT_FORMAT(" + CHR$(34)
|
||||
x1 = INSTR(a$, s$)
|
||||
IF x1 THEN
|
||||
x1 = x1 + LEN(s$)
|
||||
x2 = INSTR(x1, a$, CHR$(34))
|
||||
format$ = MID$(a$, x1, x2 - x1)
|
||||
ELSE
|
||||
s$ = "OUTPUT_ARCH("
|
||||
x1 = INSTR(a$, s$)
|
||||
IF x1 THEN
|
||||
x1 = x1 + LEN(s$)
|
||||
x2 = INSTR(x1, a$, ")")
|
||||
architecture$ = MID$(a$, x1, x2 - x1)
|
||||
END IF
|
||||
END IF
|
||||
END IF
|
||||
LOOP
|
||||
CLOSE #150
|
||||
a$ = "objcopy -Ibinary -O" + format$ + " -B" + architecture$ + " " + tmpdir2$ + "data.bin " + tmpdir2$ + "data.o"
|
||||
CHDIR ".\internal\c"
|
||||
SHELL _HIDE a$ + " 2>> ../../" + compilelog$
|
||||
CHDIR "..\.."
|
||||
|
@ -24924,14 +24945,14 @@ FUNCTION EvaluateNumbers$ (p, num() AS STRING)
|
|||
EXIT FUNCTION
|
||||
END IF
|
||||
|
||||
n1 = VAL(num(1)) \ FIX(VAL(num(2)))
|
||||
n1 = VAL(num(1)) \ VAL(num(2))
|
||||
CASE "MOD"
|
||||
IF FIX(VAL(num(2))) = 0 THEN
|
||||
EvaluateNumbers$ = "ERROR - Division By Zero"
|
||||
EXIT FUNCTION
|
||||
END IF
|
||||
|
||||
n1 = VAL(num(1)) MOD FIX(VAL(num(2)))
|
||||
n1 = VAL(num(1)) MOD VAL(num(2))
|
||||
|
||||
CASE "+": n1 = VAL(num(1)) + VAL(num(2))
|
||||
CASE "-":
|
||||
|
@ -26321,4 +26342,4 @@ SUB DebugPrint(text$)
|
|||
OPEN debugPath$ + "/qb64.log" FOR APPEND AS #fn
|
||||
PRINT #fn, text$
|
||||
CLOSE #fn
|
||||
END SUB
|
||||
END SUB
|
||||
|
|
Loading…
Reference in a new issue