VirtualBox

Changeset 14023

Show
Ignore:
Timestamp:
11/10/08 17:55:30 (2 months ago)
Author:
vboxsync
Message:

iprt/compiler/msc.h and use compiler/compiler.h instead of compiler/gcc.h

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/include/iprt/nocrt/compiler/msc.h

    r11934 r14023  
    11/** @file 
    2  * IPRT / No-CRT - GCC specifics. 
    3  * 
    4  * A quick hack for freebsd where there are no separate location 
    5  * for compiler specific headers like on linux, mingw, os2, ++. 
    6  * This file will be cleaned up later... 
     2 * IPRT / No-CRT - MSC specifics. 
    73 */ 
    84 
     
    3127 * additional information or have any questions. 
    3228 */ 
    33     
    34 #ifndef ___iprt_nocrt_compiler_gcc_h 
    35 #define ___iprt_nocrt_compiler_gcc_h 
     29 
     30#ifndef ___iprt_nocrt_compiler_msc_h 
     31#define ___iprt_nocrt_compiler_msc_h 
    3632 
    3733 
    3834/* stddef.h */ 
    39 #ifdef __PTRDIFF_TYPE__ 
    40 typedef __PTRDIFF_TYPE__ ptrdiff_t; 
    41 #elif ARCH_BITS == 32 
    42 typedef int32_t ptrdiff_t; 
    43 #elif ARCH_BITS == 64 
    44 typedef int64_t ptrdiff_t; 
    45 #else 
    46 # error "ARCH_BITS is undefined or incorrect." 
    47 #endif 
    48 #define _PTRDIFF_T_DECLARED 
     35#define errno msvcrt_errno 
     36#include <../include/stddef.h> 
     37#undef errno 
    4938 
    50 #ifdef __SIZE_TYPE__ 
    51 typedef __SIZE_TYPE__ size_t;   
    52 #elif ARCH_BITS == 32 
    53 typedef uint32_t size_t; 
    54 #elif ARCH_BITS == 64 
    55 typedef uint64_t size_t; 
    56 #else 
    57 # error "ARCH_BITS is undefined or incorrect." 
    58 #endif  
    59 #define _SIZE_T_DECLARED 
    60  
    61 #ifndef __cplusplus 
    62 # ifdef __WCHAR_TYPE__ 
    63 typedef __WCHAR_TYPE__ wchar_t; 
    64 # elif defined(RT_OS_OS2) || defined(RT_OS_WINDOWS)  
    65 typedef uint16_t wchar_t; 
    66 # else 
    67 typedef int wchar_t; 
    68 # endif 
    69 # define _WCHAR_T_DECLARED 
    70 #endif 
    71  
    72 #ifdef __WINT_TYPE__ 
    73 typedef __WINT_TYPE__ wint_t; 
    74 #else 
    75 typedef unsigned int wint_t; 
    76 #endif 
    77 #define _WINT_T_DECLARED 
    78  
    79 #ifndef NULL 
    80 # ifdef __cplusplus 
    81 #  define NULL  0 
    82 # else 
    83 #  define NULL  ((void *)0) 
    84 # endif 
    85 #endif  
    86  
    87  
    88 #ifndef offsetof 
    89 # if defined(__cplusplus) && defined(__offsetof__)  
    90 #  define offsetof(type, memb)  
    91     (__offsetof__ (reinterpret_cast<size_t>(&reinterpret_cast<const volatile char &>(static_cast<type *>(0)->memb))) ) 
    92 # else 
    93 #  define offsetof(type, memb) ((size_t)&((type *)0)->memb) 
    94 # endif                                         
    95 #endif                                         
    96  
    97  
    98 /* sys/types.h */ 
    99 #ifdef __SSIZE_TYPE__ 
    100 typedef __SSIZE_TYPE__ ssize_t;   
    101 #elif ARCH_BITS == 32 
    102 typedef int32_t ssize_t; 
    103 #elif ARCH_BITS == 64 
    104 typedef int64_t ssize_t; 
    105 #else 
    106 # define ARCH_BITS 123123 
    107 # error "ARCH_BITS is undefined or incorrect." 
    108 #endif  
    109 #define _SSIZE_T_DECLARED 
     39#undef ssize_t 
     40typedef intptr_t ssize_t; 
    11041 
    11142 
    11243/* stdarg.h */ 
    113 typedef __builtin_va_list   va_list; 
    114 #define va_start(va, arg)   __builtin_va_start(va, arg) 
    115 #define va_end(va)          __builtin_va_end(va) 
    116 #define va_arg(va, type)    __builtin_va_arg(va, type) 
    117 #define va_copy(dst, src)   __builtin_va_copy(dst, src) 
    118  
     44#include <../include/stdarg.h> 
    11945 
    12046#endif 
     47 
  • trunk/include/iprt/types.h

    r13926 r14023  
    105105 
    106106#else /* no crt */ 
    107 # include <iprt/nocrt/compiler/gcc.h> 
     107# include <iprt/nocrt/compiler/compiler.h> 
    108108#endif /* no crt */ 
    109109 

© 2008 Sun Microsystems, Inc.
ContactPrivacy policy