www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.ldc - version (AVR)

reply =?UTF-8?B?Q2hsb8Op?= Kekoa <rightfold+ck gmail.com> writes:
I’m currently using D to program an ATmega328P microcontroller, 
which interprets the AVR instruction set. Works quite well, but 
there are some definitions missing from the core library, such as 
a definition for c_long, when compiling for AVR. This makes it 
impossible to import parts of the standard library that rely on 
these definitions being there.

I’d like to add the missing features to druntime, but this 
requires a version switch for AVR. Is there such a switch? If not 
I could add it to LDC, would “AVR” be a good name?

For instance, the following code currently compiles, but ideally 
shouldn’t:

version (AVR)
     static assert(false);

Using ldc2 -mtriple=avr-atmel-none -mcpu=atmega328p
Jun 14
parent reply kinke <noone nowhere.com> writes:
On Sunday, 14 June 2020 at 19:53:35 UTC, Chloé Kekoa wrote:
 I’d like to add the missing features to druntime, but this 
 requires a version switch for AVR.
Try a v1.22 beta, version (AVR) was added with beta1.
Jun 14
parent reply "David Nadlinger" <code klickverbot.at> writes:
On 14 Jun 2020, at 21:00, kinke via digitalmars-d-ldc wrote:
 On Sunday, 14 June 2020 at 19:53:35 UTC, Chloé Kekoa wrote:
 I’d like to add the missing features to druntime, but this requires 
 a version switch for AVR.
Try a v1.22 beta, version (AVR) was added with beta1.
Also, for future reference, the table of predefined versions (not all necessarily implemented on LDC) can be found at https://dlang.org/spec/version.html#predefined-versions. — David
Jun 14
parent =?UTF-8?B?Q2hsb8Op?= Kekoa <rightfold+ck gmail.com> writes:
On Sunday, 14 June 2020 at 21:10:31 UTC, David Nadlinger wrote:
 On 14 Jun 2020, at 21:00, kinke via digitalmars-d-ldc wrote:
 On Sunday, 14 June 2020 at 19:53:35 UTC, Chloé Kekoa wrote:
 I’d like to add the missing features to druntime, but this 
 requires a version switch for AVR.
Try a v1.22 beta, version (AVR) was added with beta1.
Also, for future reference, the table of predefined versions (not all necessarily implemented on LDC) can be found at https://dlang.org/spec/version.html#predefined-versions. — David
Thanks, will give that a try and see if I can add the definitions to druntime and import some more stuff from std. :)
Jun 15