Bug 27734 - Solaris needs int_types.h instead of stdint.h
Summary: Solaris needs int_types.h instead of stdint.h
Status: RESOLVED FIXED
Alias: None
Product: libspectre
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Hardware: SPARC Solaris
: medium normal
Assignee: Carlos Garcia Campos
QA Contact: Carlos Garcia Campos
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-04-19 04:21 UTC by Dagobert Michelsen
Modified: 2010-06-01 02:12 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments

Description Dagobert Michelsen 2010-04-19 04:21:31 UTC
When compiling on Solaris 9 Sparc w/Sun Studio 12 compilation fails as Solaris 9 does not have stdint.h, but needs int_types.h. Optimally, this should be detected during configure time, but for now the following patch helped me. The patch is against 2.2, but is still needed and is functional on 0.2.5:

diff -Naur libspectre-0.2.2.orig/libspectre/spectre-device.c libspectre-0.2.2.patched/libspectre/spectre-device.c
--- libspectre-0.2.2.orig/libspectre/spectre-device.c   2008-11-25 16:15:50.000000000 +0100
+++ libspectre-0.2.2.patched/libspectre/spectre-device.c        2009-04-14 13:38:53.249669809 +0200
@@ -21,7 +21,11 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#ifdef __sun
+#include <sys/int_types.h>
+#else
 #include <stdint.h>
+#endif
 
 #include "spectre-device.h"
 #include "spectre-gs.h"
Comment 1 Carlos Garcia Campos 2010-06-01 02:12:21 UTC
In 0.2.5 we don't use uintptr_t anymore so we don't even need to include stdint.h. Fixed in git master. 

Thanks for reporting.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.