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

Compare commits

...

10 commits

Author SHA1 Message Date
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
5 changed files with 44 additions and 20 deletions

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

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