![]() |
![]() |
#1541 | |
Registered User
Join Date: Aug 2010
Location: Germany
Posts: 532
|
Quote:
R5 features further interface header file changes which render them more robust if the compiler environment claims to be the GNU 'C' compiler, but is really clang. The interface header files assumed that if gcc was showing its hand, it was a native or cross compiler targeted for AmigaOS 68k. With the current work-in-progress, you can actually use these header files directly with VSCode, for example, and no local changes required to even narrowly avoid tripping the code completion up. One of these days we might even had helpful code comments in the <clib/#?_protos.h> header files ![]() R4 was still focused on getting the gcc 68k and vbcc interface header files into shape. That there was more trouble on the horizon with cross-compilation, etc. had yet to be discovered and addressed ![]() |
|
![]() |
![]() |
#1542 | |
Registered User
Join Date: Jul 2022
Location: Australia
Posts: 49
|
Quote:
Now I'm eagerly awaiting R5! ![]() Thanks for the update. ![]() -M |
|
![]() |
![]() |
#1543 |
Registered User
Join Date: Apr 2018
Location: Germany
Posts: 193
|
Thanks for showing the CMakeLists file, I'll have a look at it.
For autocomplete when programming in VSCode I have a workaround. In vscode setting file c_cpp_properties.json I define __clang__ Code:
"defines": [ "__clang__" ], Code:
#ifdef __clang__ #include <clib/alib_protos.h> #include <clib/exec_protos.h> #include <clib/dos_protos.h> #include <clib/intuition_protos.h> #else #include <proto/alib.h> #include <proto/dos.h> #include <proto/exec.h> #include <proto/intuition.h> #endif |
![]() |
![]() |
#1544 | |||
Registered User
Join Date: Aug 2010
Location: Germany
Posts: 532
|
Quote:
Quote:
![]() Quote:
![]() Just this month we kindly received fixes for the assembly language header files found in the "datatypes" drawer: they had been broken since at least 1993. The dos.library 'C' header files have been thoroughly reworked for perhaps the first time since 1989. There's plenty to look forward to and, hopefully, make it easier to unlock what was previously hard to find in the documentation, if at all. |
|||
![]() |
![]() |
#1545 |
Registered User
Join Date: Jul 2022
Location: Australia
Posts: 49
|
Thanks Thyslo! I think there are other non-proto files that use __stdargs and ASM registers that clang refuses to work with. However, this might be a good stop-gap to eliminate a good chunk of errors!
-M |
![]() |
![]() |
#1546 |
Registered User
Join Date: Jul 2022
Location: Australia
Posts: 49
|
Ok, I replaced the NDK version installed as part of the toolchain with R4 and clang complains much less, like much less. So for now I can probably live with this until R5 is made available! Thanks again.
-M |
![]() |
![]() |
#1547 | |
Registered User
Join Date: Aug 2010
Location: Germany
Posts: 532
|
Quote:
![]() Maybe there is a future for the NDK 3.2 R4 header files in the gcc distribution after all. |
|
![]() |
![]() |
#1548 | |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 720
|
Quote:
Code:
#ifdef __clang__ #define __stdargs #define __aligned #include <clib/dos_protos.h> #include <clib/exec_protos.h> #else #include <proto/dos.h> #include <proto/exec.h> #endif |
|
![]() |
![]() |
#1549 | |
Registered User
Join Date: Aug 2010
Location: Germany
Posts: 532
|
Quote:
|
|
![]() |
![]() |
#1550 | |
Registered User
Join Date: Dec 2010
Location: Athens/Greece
Age: 53
Posts: 720
|
Quote:
|
|
![]() |
![]() |
#1551 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,360
|
I have a question: is there an equivalent of __LINE__ for current asm line number?
I'd like to set a register like Code:
move.l #__LINE__,d0 BTW I had a lot of issues with PC-relative LEA which weren't in the same unit. I got a warning when linking (using long... for ...) but the address was still PC relative and it read at the wrong location. Great assembler no matter what. Using it for 15+ projects now. |
![]() |
![]() |
#1552 | |
Registered User
Join Date: Feb 2017
Location: Denmark
Posts: 1,182
|
Quote:
The exact snippet you wrote does work as intended if you enable preprocessing and use the gcc frontend (i.e. not as, otherwise preprocess manually). This happens automatically if the input file is called ".S" rather than ".s" (yes, bad convention on case-insensitive file systems). Alternatively you can add "-x assembler-with-cpp" on the command line. Code:
/tmp$ cat test.S && m68k-amigaos-gcc -c test.S && m68k-amigaos-objdump -D test.o nop move.l #__LINE__,d0 test.o: file format amiga Disassembly of section .text: 00000000 .text: 0: 4e71 nop 2: 7002 moveq #2,d0 |
|
![]() |
![]() |
#1553 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,360
|
that's good and it works. But not in macros (.macro) where it's very useful. Maybe with #define... but multi-line defines with "" don't seem to work either. Oh damn.
|
![]() |
![]() |
#1554 | |
Registered User
Join Date: Feb 2017
Location: Denmark
Posts: 1,182
|
Quote:
![]() You can probably hack around it with another level of indirection, like: Code:
// before .macro m x,y //.. .endm m x,y // after .macro _m x,y,line move.l #\line,d0 //.. .endm #define m(x,y) _m x,y,__LINE__ m(x,y) |
|
![]() |
![]() |
#1555 |
This cat is no more
Join Date: Dec 2004
Location: FRANCE
Age: 52
Posts: 8,360
|
yes, with double macro layer it probably works. Well now it's so nonstandard that I don't want to go that route!
|
![]() |
![]() |
#1556 | |
Registered User
Join Date: Feb 2017
Location: Denmark
Posts: 1,182
|
Quote:
Code:
.macro A move.l #100+\@,d0 .endm .macro B move.l #200+\@,d0 .endm A A B A Much less convenient than __LINE__ and care needs be taken for separate compilation units, but might do what you need in this case... |
|
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
New GCC based dev toolchain for AmigaOS 3.x | cla | Coders. Releases | 8 | 24 December 2017 10:18 |
Issue with photon/xxxx WinUAE Toolchain | arpz | Coders. Asm / Hardware | 2 | 26 September 2015 22:33 |
New 68k gcc toolchain | arti | Coders. C/C++ | 17 | 31 July 2015 03:59 |
Hannibal's WinUAE Demo Toolchain 5 | Bobic | Amiga scene | 1 | 23 July 2015 21:04 |
From gcc to vbcc. | Cowcat | Coders. General | 9 | 06 June 2014 14:45 |
|
|