diff mbox

[05/14] target-mips: Move definition of uint_fast{8, 16}_t to osdep.h

Message ID 1326674823-13069-6-git-send-email-afaerber@suse.de
State New
Headers show

Commit Message

Andreas Färber Jan. 16, 2012, 12:46 a.m. UTC
osdep.h is included via qemu-common.h.

Prepares for use of [u]int_fast*_t types in softfloat code.

Signed-off-by: Andreas Färber <afaerber@suse.de>
Cc: Ben Taylor <bentaylor.solx86@gmail.com>
Cc: Aurélien Jarno <aurelien@aurel32.net>
---
 osdep.h           |    6 ++++++
 target-mips/cpu.h |    7 -------
 2 files changed, 6 insertions(+), 7 deletions(-)

Comments

Peter Maydell Jan. 16, 2012, 11:38 a.m. UTC | #1
On 16 January 2012 00:46, Andreas Färber <afaerber@suse.de> wrote:
> +#if defined(CONFIG_SOLARIS) && CONFIG_SOLARIS_VERSION < 10
> +/* uint_fast8_t and uint_fast16_t not in <sys/int_types.h> */
> +typedef unsigned char           uint_fast8_t;
> +typedef unsigned int            uint_fast16_t;
> +#endif

If you make the comment say
/* uint_fast*_t and int_fast*_t not in <sys/int_types.h> */

then it won't become out of date when your later patches add
the other types to this section.

-- PMM
Andreas Färber Jan. 16, 2012, 12:13 p.m. UTC | #2
Am 16.01.2012 12:38, schrieb Peter Maydell:
> On 16 January 2012 00:46, Andreas Färber <afaerber@suse.de> wrote:
>> +#if defined(CONFIG_SOLARIS) && CONFIG_SOLARIS_VERSION < 10
>> +/* uint_fast8_t and uint_fast16_t not in <sys/int_types.h> */
>> +typedef unsigned char           uint_fast8_t;
>> +typedef unsigned int            uint_fast16_t;
>> +#endif
> 
> If you make the comment say
> /* uint_fast*_t and int_fast*_t not in <sys/int_types.h> */
> 
> then it won't become out of date when your later patches add
> the other types to this section.

I have no clue if that is the case, I just moved it and fixed the
comment style. But sure, I can change the comment itself as well.

Andreas
Peter Maydell Jan. 16, 2012, 12:21 p.m. UTC | #3
On 16 January 2012 12:13, Andreas Färber <afaerber@suse.de> wrote:
> Am 16.01.2012 12:38, schrieb Peter Maydell:
>> On 16 January 2012 00:46, Andreas Färber <afaerber@suse.de> wrote:
>>> +#if defined(CONFIG_SOLARIS) && CONFIG_SOLARIS_VERSION < 10
>>> +/* uint_fast8_t and uint_fast16_t not in <sys/int_types.h> */
>>> +typedef unsigned char           uint_fast8_t;
>>> +typedef unsigned int            uint_fast16_t;
>>> +#endif
>>
>> If you make the comment say
>> /* uint_fast*_t and int_fast*_t not in <sys/int_types.h> */
>>
>> then it won't become out of date when your later patches add
>> the other types to this section.
>
> I have no clue if that is the case, I just moved it and fixed the
> comment style. But sure, I can change the comment itself as well.

Well, your later patches add more typedefs here, right? So we need
to know: either old Solaris doesn't have any of these types and we
must typedef them all (and the comment should match that), or it
is only missing the two currently noted here, in which case we don't
need to and should not add further typedefs. What we don't want is
to have a comment and code which disagree...

-- PMM
Andreas Färber Jan. 16, 2012, 12:24 p.m. UTC | #4
Am 16.01.2012 13:21, schrieb Peter Maydell:
> On 16 January 2012 12:13, Andreas Färber <afaerber@suse.de> wrote:
>> Am 16.01.2012 12:38, schrieb Peter Maydell:
>>> On 16 January 2012 00:46, Andreas Färber <afaerber@suse.de> wrote:
>>>> +#if defined(CONFIG_SOLARIS) && CONFIG_SOLARIS_VERSION < 10
>>>> +/* uint_fast8_t and uint_fast16_t not in <sys/int_types.h> */
>>>> +typedef unsigned char           uint_fast8_t;
>>>> +typedef unsigned int            uint_fast16_t;
>>>> +#endif
>>>
>>> If you make the comment say
>>> /* uint_fast*_t and int_fast*_t not in <sys/int_types.h> */
>>>
>>> then it won't become out of date when your later patches add
>>> the other types to this section.
>>
>> I have no clue if that is the case, I just moved it and fixed the
>> comment style. But sure, I can change the comment itself as well.
> 
> Well, your later patches add more typedefs here, right? So we need
> to know: either old Solaris doesn't have any of these types and we
> must typedef them all (and the comment should match that), or it
> is only missing the two currently noted here, in which case we don't
> need to and should not add further typedefs. What we don't want is
> to have a comment and code which disagree...

I'm hoping Ben can clarify. Fabrice attributed the Solaris/sparc support
to him.

/-F
diff mbox

Patch

diff --git a/osdep.h b/osdep.h
index 432b91e..8f45a96 100644
--- a/osdep.h
+++ b/osdep.h
@@ -10,6 +10,12 @@ 
 
 #include <sys/time.h>
 
+#if defined(CONFIG_SOLARIS) && CONFIG_SOLARIS_VERSION < 10
+/* uint_fast8_t and uint_fast16_t not in <sys/int_types.h> */
+typedef unsigned char           uint_fast8_t;
+typedef unsigned int            uint_fast16_t;
+#endif
+
 #ifndef glue
 #define xglue(x, y) x ## y
 #define glue(x, y) xglue(x, y)
diff --git a/target-mips/cpu.h b/target-mips/cpu.h
index 71cb4e8..23564a7 100644
--- a/target-mips/cpu.h
+++ b/target-mips/cpu.h
@@ -15,13 +15,6 @@ 
 #include "cpu-defs.h"
 #include "softfloat.h"
 
-// uint_fast8_t and uint_fast16_t not in <sys/int_types.h>
-// XXX: move that elsewhere
-#if defined(CONFIG_SOLARIS) && CONFIG_SOLARIS_VERSION < 10
-typedef unsigned char           uint_fast8_t;
-typedef unsigned int            uint_fast16_t;
-#endif
-
 struct CPUMIPSState;
 
 typedef struct r4k_tlb_t r4k_tlb_t;