1
1
Fork 0
mirror of https://github.com/QB64Official/qb64.git synced 2024-05-12 12:00:14 +00:00

Compare commits

...

18 commits

Author SHA1 Message Date
Brickviking aa0e525b49
Merge 97be38ec96 into a62074f27b 2023-10-13 14:17:31 -05:00
Cory Smith a62074f27b
Merge pull request #47 from visionmercer/master
cross-platform terminal consistency for locate command.
2023-10-13 14:16:56 -05:00
Cory Smith c7fd3bb5d9
Merge pull request #48 from fitzsim/ppc64-debian-fixes-1
PPC64 Debian fixes
2023-10-13 14:15:02 -05:00
Cory Smith 53784f5296
Merge pull request #54 from visionmercer/evaluator
Evaluator
2023-10-13 14:13:38 -05:00
Cory Smith 60d2234540
Merge pull request #52 from visionmercer/console-width-and-height
Console Width and Height
2023-10-13 14:12:47 -05:00
visionmercer 3cef4b4088 Update qb64.bas 2023-05-03 13:30:14 +02:00
visionmercer 04957e9b85 Update qb64.bas 2023-05-03 13:26:12 +02:00
visionmercer 04546ae979 Update libqb.cpp 2023-05-02 11:57:19 +02:00
Thomas Fitzsimmons 7ad1aac065 Derive objcopy arguments from GNU ld output 2023-02-28 21:37:09 -05:00
Thomas Fitzsimmons 60e3bc4581 os.h: Also check for uppercase PPC64 define 2023-02-28 21:35:50 -05:00
visionmercer ab386e04f1 Update libqb.cpp
cross-platform consistency for locate command
2023-01-24 13:04:40 +01:00
brickviking 97be38ec96 Correcting text to be the same as above string 2022-09-27 16:17:41 +13:00
Brickviking 319fc322ee
Reprodding CI build
Minimal change just  to get Github's CI to pass a build.

Signed-off-by: Brickviking <brickviking@gmail.com>
2022-09-17 22:26:46 +12:00
brickviking fcc61cc722 Checking Windows version
If we're running on XP, add the insecure switch to curl

You may also need this for Vista
2022-09-12 23:35:27 +12:00
brickviking 3fead708b4 Checking if user has 7zip already 2022-09-12 21:47:32 +12:00
brickviking 24f1893c39 Correcting variable test 2022-09-12 18:10:37 +12:00
brickviking a568095ad0 Check if we downloaded curl previously 2022-09-11 20:29:03 +12:00
brickviking bfb244cf50 Work around missing CHOICE.EXE 2022-09-11 20:28:41 +12:00
7 changed files with 78 additions and 30 deletions

View file

@ -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 (

View file

@ -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;

View file

@ -1 +0,0 @@
objcopy -Ibinary -Oelf32-i386 -Bi386

View file

@ -1,3 +0,0 @@
objcopy -Ibinary -Oelf64-x86-64 -Bi386:x86-64

View file

@ -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

View file

@ -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

View file

@ -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