www.digitalmars.com         C & C++   DMDScript  

D.gnu - OS version symbols

reply Johannes Pfau <nospam example.com> writes:
I started implementing the CPU version symbols:
https://gist.github.com/4701086

It doesn't mirror the C++ macro structure as we usually don't have to
overwrite the macro definitions for specific architectures. So the
generic definitions are in the top level OS files which are used for
every architecture. It's still possible to add architecture and OS
specific versions, see e.g. Android or GDC_MinGW64.


As a next step I'd like to remove target-ver-syms.sh, but there's one
problem: What to do about the TARGET_OSX,... preprocessor definitions?
Should I change all of those to runtime variables? Also: Should extra
code be added to the TARGET_OS_D_BUILTINS macros or could we just use
findCondition to check if version(OSX) is set and then use that result?
Feb 03 2013
parent Iain Buclaw <ibuclaw ubuntu.com> writes:
--20cf3005dec2bb63c304d4e3683e
Content-Type: text/plain; charset=ISO-8859-1

On 3 February 2013 09:54, Johannes Pfau <nospam example.com> wrote:

 I started implementing the CPU version symbols:
 https://gist.github.com/4701086

 It doesn't mirror the C++ macro structure as we usually don't have to
 overwrite the macro definitions for specific architectures. So the
 generic definitions are in the top level OS files which are used for
 every architecture. It's still possible to add architecture and OS
 specific versions, see e.g. Android or GDC_MinGW64.

compiler. I would hint that the same convention should be used here too.
 As a next step I'd like to remove target-ver-syms.sh, but there's one
 problem: What to do about the TARGET_OSX,... preprocessor definitions?
 Should I change all of those to runtime variables? Also: Should extra
 code be added to the TARGET_OS_D_BUILTINS macros or could we just use
 findCondition to check if version(OSX) is set and then use that result?

A better way would be to remove all TARGET_ macros from the D frontend ( example: http://bit.ly/WSzRlk ) and pushing them into the backend away from the code that GDC/LDC shares with DMD. Regards, -- Iain Buclaw *(p < e ? p++ : p) = (c & 0x0f) + '0'; --20cf3005dec2bb63c304d4e3683e Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On 3= February 2013 09:54, Johannes Pfau <span dir=3D"ltr">&lt;<a href=3D"mailto= :nospam example.com" target=3D"_blank">nospam example.com</a>&gt;</span> wr= ote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex= ;border-left:1px solid rgb(204,204,204);padding-left:1ex"> I started implementing the CPU version symbols:<br> <a href=3D"https://gist.github.com/4701086" target=3D"_blank">https://gist.= github.com/4701086</a><br> <br></blockquote><div><br></div><div>Nice. :-)<br><br><br></div><div>=A0</d= iv><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bord= er-left:1px solid rgb(204,204,204);padding-left:1ex"> It doesn&#39;t mirror the C++ macro structure as we usually don&#39;t have = to<br> overwrite the macro definitions for specific architectures. So the<br> generic definitions are in the top level OS files which are used for<br> every architecture. It&#39;s still possible to add architecture and OS<br> specific versions, see e.g. Android or GDC_MinGW64.<br> <br> <br></blockquote><div><br></div><div>Typically in the we&#39;ve used GNU_xx= x for identifiers specific to our compiler.=A0 I would hint that the same c= onvention should be used here too.<br></div><div><br>=A0</div><blockquote c= lass=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px soli= d rgb(204,204,204);padding-left:1ex"> As a next step I&#39;d like to remove target-ver-syms.sh, but there&#39;s o= ne<br> problem: What to do about the TARGET_OSX,... preprocessor definitions?<br> Should I change all of those to runtime variables? Also: Should extra<br> code be added to the TARGET_OS_D_BUILTINS macros or could we just use<br> findCondition to check if version(OSX) is set and then use that result?<br> </blockquote></div><br></div><div class=3D"gmail_extra">A better way would = be to remove all TARGET_ macros from the D frontend ( example: <a href=3D"h= ttp://bit.ly/WSzRlk">http://bit.ly/WSzRlk</a> ) and pushing them into the b= ackend away from the code that GDC/LDC shares with DMD.<br> <br><br clear=3D"all"></div><div class=3D"gmail_extra">Regards,<br></div><d= iv class=3D"gmail_extra">-- <br>Iain Buclaw<br><br>*(p &lt; e ? p++ : p) = =3D (c &amp; 0x0f) + &#39;0&#39;; </div></div> --20cf3005dec2bb63c304d4e3683e--
Feb 04 2013