mailing list of musl libc
 help / color / mirror / code / Atom feed
* [PATCH] Add stdc-predef.h.
@ 2016-04-01  6:31 Masanori Ogino
  2016-04-01  9:37 ` Szabolcs Nagy
  0 siblings, 1 reply; 3+ messages in thread
From: Masanori Ogino @ 2016-04-01  6:31 UTC (permalink / raw)
  To: musl; +Cc: Masanori Ogino

Reference: http://www.openwall.com/lists/musl/2016/03/31/2

Signed-off-by: Masanori Ogino <masanori.ogino@gmail.com>
---
 include/stdc-predef.h | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)
 create mode 100644 include/stdc-predef.h

diff --git a/include/stdc-predef.h b/include/stdc-predef.h
new file mode 100644
index 0000000..f599a33
--- /dev/null
+++ b/include/stdc-predef.h
@@ -0,0 +1,18 @@
+#ifndef _STDC_PREDEF_H
+#define _STDC_PREDEF_H
+
+/* FIXME: What is the exactly version supported by musl? */
+/* ISO/IEC 10646:2011, Uncode 6.0 except U+20B9 INDIAN RUPEE SIGN */
+#define __STDC_ISO_10646__ 201103L
+#define __STDC_UTF_16__ 1
+#define __STDC_UTF_32__ 1
+
+#if defined(__GCC_IEC_559) && __GCC_IEC_559 > 0
+#define __STDC_IEC_559__ 1
+#endif
+
+/* GCC does not support the "Annex G" complex arithmetic even though
+ * __GCC_IEC_559_COMPLEX is defined. Thus, we leave __STDC_IEC_559_COMPLEX__
+ * undefined for now. */
+
+#endif
-- 
2.7.3



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Add stdc-predef.h.
  2016-04-01  6:31 [PATCH] Add stdc-predef.h Masanori Ogino
@ 2016-04-01  9:37 ` Szabolcs Nagy
  2016-04-05  1:48   ` Masanori Ogino
  0 siblings, 1 reply; 3+ messages in thread
From: Szabolcs Nagy @ 2016-04-01  9:37 UTC (permalink / raw)
  To: musl; +Cc: Masanori Ogino

* Masanori Ogino <masanori.ogino@gmail.com> [2016-04-01 15:31:13 +0900]:
> Reference: http://www.openwall.com/lists/musl/2016/03/31/2
> 
> Signed-off-by: Masanori Ogino <masanori.ogino@gmail.com>
> ---
>  include/stdc-predef.h | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
>  create mode 100644 include/stdc-predef.h
> 
> diff --git a/include/stdc-predef.h b/include/stdc-predef.h
> new file mode 100644
> index 0000000..f599a33
> --- /dev/null
> +++ b/include/stdc-predef.h
> @@ -0,0 +1,18 @@
> +#ifndef _STDC_PREDEF_H
> +#define _STDC_PREDEF_H
> +
> +/* FIXME: What is the exactly version supported by musl? */
> +/* ISO/IEC 10646:2011, Uncode 6.0 except U+20B9 INDIAN RUPEE SIGN */
> +#define __STDC_ISO_10646__ 201103L

i think it's unicode 6.1, that is ISO/IEC 10646:2012
#define __STDC_ISO_10646__ 201206L

> +#define __STDC_UTF_16__ 1
> +#define __STDC_UTF_32__ 1

these are defined by gcc since it matters
for u'x' and U'x' literals.

> +
> +#if defined(__GCC_IEC_559) && __GCC_IEC_559 > 0

undefined macros are implicitly 0 so
#if __GCC_IEC_559 > 0

> +#define __STDC_IEC_559__ 1
> +#endif
> +
> +/* GCC does not support the "Annex G" complex arithmetic even though
> + * __GCC_IEC_559_COMPLEX is defined. Thus, we leave __STDC_IEC_559_COMPLEX__
> + * undefined for now. */

this comment should go into the commit log

(this file will be included into every
translation unit so it should be minimal)

> +
> +#endif
> -- 
> 2.7.3


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] Add stdc-predef.h.
  2016-04-01  9:37 ` Szabolcs Nagy
@ 2016-04-05  1:48   ` Masanori Ogino
  0 siblings, 0 replies; 3+ messages in thread
From: Masanori Ogino @ 2016-04-05  1:48 UTC (permalink / raw)
  To: musl, Masanori Ogino

Thank you for reviewing.

2016-04-01 18:37 GMT+09:00 Szabolcs Nagy <nsz@port70.net>:
> * Masanori Ogino <masanori.ogino@gmail.com> [2016-04-01 15:31:13 +0900]:
>> Reference: http://www.openwall.com/lists/musl/2016/03/31/2
>>
>> Signed-off-by: Masanori Ogino <masanori.ogino@gmail.com>
>> ---
>>  include/stdc-predef.h | 18 ++++++++++++++++++
>>  1 file changed, 18 insertions(+)
>>  create mode 100644 include/stdc-predef.h
>>
>> diff --git a/include/stdc-predef.h b/include/stdc-predef.h
>> new file mode 100644
>> index 0000000..f599a33
>> --- /dev/null
>> +++ b/include/stdc-predef.h
>> @@ -0,0 +1,18 @@
>> +#ifndef _STDC_PREDEF_H
>> +#define _STDC_PREDEF_H
>> +
>> +/* FIXME: What is the exactly version supported by musl? */
>> +/* ISO/IEC 10646:2011, Uncode 6.0 except U+20B9 INDIAN RUPEE SIGN */
>> +#define __STDC_ISO_10646__ 201103L
>
> i think it's unicode 6.1, that is ISO/IEC 10646:2012
> #define __STDC_ISO_10646__ 201206L

OK.

>> +#define __STDC_UTF_16__ 1
>> +#define __STDC_UTF_32__ 1
>
> these are defined by gcc since it matters
> for u'x' and U'x' literals.

I confirmed that they are defined with -std=gnu11. Thank you for
pointing it out.

>> +
>> +#if defined(__GCC_IEC_559) && __GCC_IEC_559 > 0
>
> undefined macros are implicitly 0 so
> #if __GCC_IEC_559 > 0
>
>> +#define __STDC_IEC_559__ 1
>> +#endif
>> +
>> +/* GCC does not support the "Annex G" complex arithmetic even though
>> + * __GCC_IEC_559_COMPLEX is defined. Thus, we leave __STDC_IEC_559_COMPLEX__
>> + * undefined for now. */
>
> this comment should go into the commit log
>
> (this file will be included into every
> translation unit so it should be minimal)

Sure. I will revise them.

-- 
Masanori Ogino


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-04-05  1:48 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-04-01  6:31 [PATCH] Add stdc-predef.h Masanori Ogino
2016-04-01  9:37 ` Szabolcs Nagy
2016-04-05  1:48   ` Masanori Ogino

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).