Bug 27734

Summary: Solaris needs int_types.h instead of stdint.h
Product: libspectre Reporter: Dagobert Michelsen <dam>
Component: generalAssignee: Carlos Garcia Campos <carlosgc>
Status: RESOLVED FIXED QA Contact: Carlos Garcia Campos <carlosgc>
Severity: normal    
Priority: medium    
Version: unspecified   
Hardware: SPARC   
OS: Solaris   
Whiteboard:
i915 platform: i915 features:

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.