Commit 0ddb4e02f92b84c812c38b0bf14a1981daa5502a

  • avatar
  • Petr Ovtchenkov (Committer)
  • Thu Oct 09 08:33:25 CEST 2008
  • avatar
  • Rick Weisner <rick.weisner @s…n.com> (Author)
  • Thu Oct 09 08:33:25 CEST 2008
Fixes for 32-bit Solaris 10, 11, SunPro CC (SunStudio 12)

This fix build for 32-bit Solaris, IA32 arch.
  
11# -*- makefile -*- Time-stamp: <04/08/23 23:07:35 ptr>
22
33#OPT += -xcode=pic32
4OPT += -m64 -KPIC
4#OPT += -m64 -KPIC
5OPT += -KPIC
56
67dbg-shared: LDFLAGS += -G -Qoption ld -z,initfirst -h$(SO_NAME_DBGxx) ${LDSEARCH} ${NOSTDLIB}
78stldbg-shared: LDFLAGS += -G -Qoption ld -z,initfirst -h$(SO_NAME_STLDBGxx) ${LDSEARCH} ${NOSTDLIB}
  
22
33SRCROOT := ../..
44COMPILER_NAME := CC
5OPT= -m64 -xO2
5#OPT= -m64 -xO2
6OPT= -xO2
67
78ALL_TAGS := release-shared stldbg-shared
89STLPORT_DIR := ../../..
  
12008-10-08 Petr Ovtchenkov <complement@users.sourceforge.net>
12008-10-09 Petr Ovtchenkov <complement@users.sourceforge.net>
22
3 * Repository: support 64-bit Solaris 10 and 11 with SunPro's
4 CC; derived from patch #2152319, thanks Rick Weisner.
3 * Repository: support 32-bit and 64-bit Solaris 10 and 11
4 with SunPro's CC (SunStudio 12); derived from patch #2152319,
5 thanks Rick Weisner.
56
672008-10-07 Petr Ovtchenkov <complement@users.sourceforge.net>
78
  
2424
2525#ifndef _STLP_STDIO_FILE_H
2626#define _STLP_STDIO_FILE_H
27# if defined(__SunOS_5_10) || defined(__SunOS_5_11)
28# if !defined(__amd64) && !defined(__sparcv9)
29# include <stdio.h>
30# endif
31# endif
2732
2833// This file provides a low-level interface between the internal
2934// representation of struct FILE, from the C stdio library, and
124124typedef unsigned char* _File_ptr_type;
125125#endif
126126
127#if (defined(__SunOS_5_10) || defined(__SunOS_5_11)) && (!defined(__amd64) && !defined(__sparcv9))
128inline int _FILE_fd(const FILE *__f) { return fileno((FILE *)__f); }
129#else
127130inline int _FILE_fd(const FILE *__f) { return __f->_file; }
131#endif
128132inline char* _FILE_I_begin(const FILE *__f) { return (char*) __f->_base; }
129133inline char* _FILE_I_next(const FILE *__f) { return (char*) __f->_ptr; }
130134inline char* _FILE_I_end(const FILE *__f)
  
2525#endif
2626
2727#if defined(SunOS_5_11) || defined(__SunOS_5_10)
28#include <stdlib.h>
28# if defined(__amd64) || defined(__sparcv9)
29# include <stdlib.h>
30# endif
2931#endif
3032
3133#include <fstream>
  
2323
2424#ifndef _STLP_INTERNAL_THREADS_H
2525#define _STLP_INTERNAL_THREADS_H
26
2627#if defined(__SunOS_5_11) || defined(__SunOS_5_10)
27typedef unsigned long size_t;
28# include <sys/types.h>
2829#endif
2930
3031// Supported threading models are native SGI, pthreads, uithreads
193193# elif defined(_STLP_AMD_SOLARIS_THREADS)
194194# include <atomic.h>
195195
196 inline __stl_atomic_t stlp_atomic_increment(volatile __stl_atomic_t* __ptr) { atomic_inc_ulong(__ptr); return(*__ptr);}
196 inline __stl_atomic_t stlp_atomic_increment(volatile __stl_atomic_t* __ptr) { atomic_inc_ulong((unsigned long*)__ptr); return(*__ptr);}
197197# define _STLP_ATOMIC_INCREMENT(__pvalue1) stlp_atomic_increment(__pvalue1)
198198
199 inline __stl_atomic_t stlp_atomic_decrement(volatile __stl_atomic_t* __ptr) { atomic_dec_ulong(__ptr); return(*__ptr);}
199 inline __stl_atomic_t stlp_atomic_decrement(volatile __stl_atomic_t* __ptr) { atomic_dec_ulong((unsigned long *)__ptr); return(*__ptr);}
200200# define _STLP_ATOMIC_DECREMENT(__pvalue1) stlp_atomic_decrement(__pvalue1)
201201
202 inline __stl_atomic_t stlp_atomic_exchange(volatile __stl_atomic_t* __target, __stl_atomic_t __val) {atomic_swap_ulong(__target,__val); return *__target;}
202 inline __stl_atomic_t stlp_atomic_exchange(volatile __stl_atomic_t* __target, __stl_atomic_t __val) {atomic_swap_ulong((unsigned long *)__target,(unsigned long)__val); return *__target;}
203203# define _STLP_ATOMIC_EXCHANGE(__pvalue1, __value2) stlp_atomic_exchange(__pvalue1,__value2)
204204
205205# elif defined (_STLP_UITHREADS)