VirtualBox

Changeset 96013 in vbox for trunk/include/iprt/nocrt


Ignore:
Timestamp:
Aug 3, 2022 9:56:01 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
152807
Message:

include/iprt/nocrt: More prototypes & some fixes. bugref:10261

Location:
trunk/include/iprt/nocrt
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/nocrt/ctype.h

    r95975 r96013  
    4545#define islower(a_ch)       RT_C_IS_LOWER(a_ch)
    4646
     47#define tolower(a_ch)       RT_C_TO_LOWER(a_ch)
     48#define toupper(a_ch)       RT_C_TO_UPPER(a_ch)
     49
    4750#endif /* !IPRT_INCLUDED_nocrt_ctype_h */
    4851
  • trunk/include/iprt/nocrt/fcntl.h

    r95975 r96013  
    3030#endif
    3131
     32#include <iprt/nocrt/time.h> /* to establish the timespec and timeval types before iprt/file.h includes iprt/time.h */
    3233#include <iprt/file.h>
    3334
  • trunk/include/iprt/nocrt/io.h

    r95976 r96013  
    3030#endif
    3131
    32 #include <fcntl.h>
    33 #include <sys/stat.h>
     32#include <iprt/nocrt/fcntl.h>
     33#include <iprt/nocrt/sys/stat.h>
     34#include <iprt/nocrt/unistd.h>
    3435
    3536
  • trunk/include/iprt/nocrt/math.h

    r95975 r96013  
    8787#endif
    8888
    89 #if 1 /* __ISO_C_VISIBLE >= 1999*/
    90 #define FP_ILOGB0   (-__INT_MAX)
    91 #define FP_ILOGBNAN __INT_MAX
    92 
    93 #ifdef __MATH_BUILTIN_CONSTANTS
    94 #define HUGE_VALF   __builtin_huge_valf()
    95 #define HUGE_VALL   __builtin_huge_vall()
    96 #define INFINITY    __builtin_inf()
    97 #define NAN     __builtin_nan("")
    98 #else
    99 #define HUGE_VALF   (float)HUGE_VAL
    100 #define HUGE_VALL   (long double)HUGE_VAL
    101 #define INFINITY    HUGE_VALF
    102 #define NAN     (__nan.__uf)
    103 #endif /* __MATH_BUILTIN_CONSTANTS */
    104 
    105 #ifndef IPRT_NO_CRT
    106 #define MATH_ERRNO  1
    107 #endif
    108 #define MATH_ERREXCEPT  2
    109 #define math_errhandling    MATH_ERREXCEPT
    110 
    111 /* XXX We need a <machine/math.h>. */
    112 #if defined(__ia64__) || defined(__sparc64__)
    113 #define FP_FAST_FMA
    114 #endif
    115 #ifdef __ia64__
    116 #define FP_FAST_FMAL
    117 #endif
    118 #define FP_FAST_FMAF
    119 
    120 /* Symbolic constants to classify floating point numbers. */
    121 #define FP_INFINITE 0x01
    122 #define FP_NAN      0x02
    123 #define FP_NORMAL   0x04
    124 #define FP_SUBNORMAL    0x08
    125 #define FP_ZERO     0x10
    126 #define fpclassify(x) \
    127     ((sizeof (x) == sizeof (float)) ? RT_NOCRT(__fpclassifyf)(x) \
    128     : (sizeof (x) == sizeof (double)) ? RT_NOCRT(__fpclassifyd)(x) \
    129     : RT_NOCRT(__fpclassifyl)(x))
    130 
    131 #define isfinite(x)                 \
    132     ((sizeof (x) == sizeof (float)) ? RT_NOCRT(__isfinitef)(x)    \
    133     : (sizeof (x) == sizeof (double)) ? RT_NOCRT(__isfinite)(x)   \
    134     : RT_NOCRT(__isfinitel)(x))
    135 #define isinf(x)                    \
    136     ((sizeof (x) == sizeof (float)) ? RT_NOCRT(__isinff)(x)   \
    137     : (sizeof (x) == sizeof (double)) ? isinf(x)    \
    138     : RT_NOCRT(__isinfl)(x))
    139 #define isnan(x)                    \
    140     ((sizeof (x) == sizeof (float)) ? isnanf(x)     \
    141     : (sizeof (x) == sizeof (double)) ? isnan(x)    \
    142     : RT_NOCRT(__isnanl)(x))
    143 #define isnormal(x)                 \
    144     ((sizeof (x) == sizeof (float)) ? RT_NOCRT(__isnormalf)(x)    \
    145     : (sizeof (x) == sizeof (double)) ? RT_NOCRT(__isnormal)(x)   \
    146     : RT_NOCRT(__isnormall)(x))
    147 
    148 #ifdef __MATH_BUILTIN_RELOPS
    149 #define isgreater(x, y)     __builtin_isgreater((x), (y))
    150 #define isgreaterequal(x, y)    __builtin_isgreaterequal((x), (y))
    151 #define isless(x, y)        __builtin_isless((x), (y))
    152 #define islessequal(x, y)   __builtin_islessequal((x), (y))
    153 #define islessgreater(x, y) __builtin_islessgreater((x), (y))
    154 #define isunordered(x, y)   __builtin_isunordered((x), (y))
    155 #else
    156 #define isgreater(x, y)     (!isunordered((x), (y)) && (x) > (y))
    157 #define isgreaterequal(x, y)    (!isunordered((x), (y)) && (x) >= (y))
    158 #define isless(x, y)        (!isunordered((x), (y)) && (x) < (y))
    159 #define islessequal(x, y)   (!isunordered((x), (y)) && (x) <= (y))
    160 #define islessgreater(x, y) (!isunordered((x), (y)) && \
    161                     ((x) > (y) || (y) > (x)))
    162 #define isunordered(x, y)   (isnan(x) || isnan(y))
    163 #endif /* __MATH_BUILTIN_RELOPS */
    164 
    165 #define signbit(x)                  \
    166     ((sizeof (x) == sizeof (float)) ? RT_NOCRT(__signbitf)(x) \
    167     : (sizeof (x) == sizeof (double)) ? RT_NOCRT(__signbit)(x)    \
    168     : RT_NOCRT(__signbitl)(x))
    169 
    170 typedef double  double_t;
    171 typedef float   float_t;
    172 #endif /* __ISO_C_VISIBLE >= 1999 */
    173 
    17489/*
    17590 * XOPEN/SVID
     
    269184double  RT_NOCRT(fma)(double, double, double);
    270185double  RT_NOCRT(hypot)(double, double);
    271 int RT_NOCRT(ilogb)(double) __pure2;
    272 /*int isinf(double) __pure2;*/
    273 /*int isnan(double) __pure2;*/
     186int     RT_NOCRT(ilogb)(double) __pure2;
     187int     RT_NOCRT(isinf)(double) __pure2;
     188int     RT_NOCRT(isnan)(double) __pure2;
    274189double  RT_NOCRT(lgamma)(double);
    275190long long RT_NOCRT(llrint)(double);
     
    557472long double RT_NOCRT(gammal)(long double);
    558473#endif
     474
     475
    559476RT_C_DECLS_END
    560477
     478
     479/* bird 2022-08-03: moved this block down so we can prototype isnan & isinf without runnning into the macro forms. */
     480#if 1 /* __ISO_C_VISIBLE >= 1999*/
     481#define FP_ILOGB0   (-__INT_MAX)
     482#define FP_ILOGBNAN __INT_MAX
     483
     484#ifdef __MATH_BUILTIN_CONSTANTS
     485#define HUGE_VALF   __builtin_huge_valf()
     486#define HUGE_VALL   __builtin_huge_vall()
     487#define INFINITY    __builtin_inf()
     488#define NAN     __builtin_nan("")
     489#else
     490#define HUGE_VALF   (float)HUGE_VAL
     491#define HUGE_VALL   (long double)HUGE_VAL
     492#define INFINITY    HUGE_VALF
     493#define NAN     (__nan.__uf)
     494#endif /* __MATH_BUILTIN_CONSTANTS */
     495
     496#ifndef IPRT_NO_CRT
     497#define MATH_ERRNO  1
     498#endif
     499#define MATH_ERREXCEPT  2
     500#define math_errhandling    MATH_ERREXCEPT
     501
     502/* XXX We need a <machine/math.h>. */
     503#if defined(__ia64__) || defined(__sparc64__)
     504#define FP_FAST_FMA
     505#endif
     506#ifdef __ia64__
     507#define FP_FAST_FMAL
     508#endif
     509#define FP_FAST_FMAF
     510
     511/* Symbolic constants to classify floating point numbers. */
     512#define FP_INFINITE 0x01
     513#define FP_NAN      0x02
     514#define FP_NORMAL   0x04
     515#define FP_SUBNORMAL    0x08
     516#define FP_ZERO     0x10
     517#define fpclassify(x) \
     518    ((sizeof (x) == sizeof (float)) ? RT_NOCRT(__fpclassifyf)(x) \
     519    : (sizeof (x) == sizeof (double)) ? RT_NOCRT(__fpclassifyd)(x) \
     520    : RT_NOCRT(__fpclassifyl)(x))
     521
     522#define isfinite(x)                 \
     523    ((sizeof (x) == sizeof (float)) ? RT_NOCRT(__isfinitef)(x)    \
     524    : (sizeof (x) == sizeof (double)) ? RT_NOCRT(__isfinite)(x)   \
     525    : RT_NOCRT(__isfinitel)(x))
     526#define isinf(x)                    \
     527    ((sizeof (x) == sizeof (float)) ? RT_NOCRT(__isinff)(x)   \
     528    : (sizeof (x) == sizeof (double)) ? isinf(x)    \
     529    : RT_NOCRT(__isinfl)(x))
     530#define isnan(x)                    \
     531    ((sizeof (x) == sizeof (float)) ? isnanf(x)     \
     532    : (sizeof (x) == sizeof (double)) ? isnan(x)    \
     533    : RT_NOCRT(__isnanl)(x))
     534#define isnormal(x)                 \
     535    ((sizeof (x) == sizeof (float)) ? RT_NOCRT(__isnormalf)(x)    \
     536    : (sizeof (x) == sizeof (double)) ? RT_NOCRT(__isnormal)(x)   \
     537    : RT_NOCRT(__isnormall)(x))
     538
     539#ifdef __MATH_BUILTIN_RELOPS
     540#define isgreater(x, y)     __builtin_isgreater((x), (y))
     541#define isgreaterequal(x, y)    __builtin_isgreaterequal((x), (y))
     542#define isless(x, y)        __builtin_isless((x), (y))
     543#define islessequal(x, y)   __builtin_islessequal((x), (y))
     544#define islessgreater(x, y) __builtin_islessgreater((x), (y))
     545#define isunordered(x, y)   __builtin_isunordered((x), (y))
     546#else
     547#define isgreater(x, y)     (!isunordered((x), (y)) && (x) > (y))
     548#define isgreaterequal(x, y)    (!isunordered((x), (y)) && (x) >= (y))
     549#define isless(x, y)        (!isunordered((x), (y)) && (x) < (y))
     550#define islessequal(x, y)   (!isunordered((x), (y)) && (x) <= (y))
     551#define islessgreater(x, y) (!isunordered((x), (y)) && \
     552                    ((x) > (y) || (y) > (x)))
     553#define isunordered(x, y)   (isnan(x) || isnan(y))
     554#endif /* __MATH_BUILTIN_RELOPS */
     555
     556#define signbit(x)                  \
     557    ((sizeof (x) == sizeof (float)) ? RT_NOCRT(__signbitf)(x) \
     558    : (sizeof (x) == sizeof (double)) ? RT_NOCRT(__signbit)(x)    \
     559    : RT_NOCRT(__signbitl)(x))
     560
     561typedef double  double_t;
     562typedef float   float_t;
     563#endif /* __ISO_C_VISIBLE >= 1999 */
    561564
    562565
     
    660663# define drem RT_NOCRT(drem)
    661664# define finite RT_NOCRT(finite)
     665# define isinf RT_NOCRT(isinf)
     666# define isnan RT_NOCRT(isnan)
    662667# define isnanf RT_NOCRT(isnanf)
    663668# define gamma_r RT_NOCRT(gamma_r)
  • trunk/include/iprt/nocrt/stdio.h

    r95985 r96013  
    3131
    3232#include <iprt/stream.h>
     33#include <iprt/nocrt/sys/types.h> /* errno_t, off_t */
    3334
    3435typedef RTFOFF fpos_t;
     36
    3537
    3638#ifdef IPRT_NO_CRT_FOR_3RD_PARTY
     
    3941 * check each printf and fprintf call as IPRT isn't 100% compatible...
    4042 */
     43RT_C_DECLS_BEGIN
     44
    4145typedef struct RTSTREAM FILE;
    4246# define stdin    g_pStdIn
     
    5559FILE   *RT_NOCRT(fopen)(const char *pszFilename, const char *pszMode);
    5660FILE   *RT_NOCRT(fdopen)(int fd, const char *pszMode);
     61FILE   *RT_NOCRT(tmpfile)(void);
     62errno_t RT_NOCRT(tmpfile_s)(FILE **ppFile);
     63int     RT_NOCRT(fileno)(FILE *pFile);
    5764int     RT_NOCRT(fclose)(FILE *pFile);
    5865int     RT_NOCRT(fflush)(FILE *pFile);
    5966int     RT_NOCRT(setvbuf)(FILE *pFile, char *pchBuf, int iBufferingType, size_t cbBuf);
     67int     RT_NOCRT(fseek)(FILE *pFile, long, int);
     68int     RT_NOCRT(fseeko)(FILE *pFile, off_t, int);
     69long    RT_NOCRT(ftell)(FILE *pFile);
     70off_t   RT_NOCRT(ftello)(FILE *pFile);
    6071size_t  RT_NOCRT(fwrite)(void const *pvBuf, size_t cbItem, size_t cItems, FILE *pFile);
     72int     RT_NOCRT(fputs)(const char *psz, FILE *pFile);
     73int     RT_NOCRT(puts)(const char *psz);
     74int     RT_NOCRT(fputc)(int, FILE *pFile);
    6175size_t  RT_NOCRT(fread)(void *pvBuf, size_t cbItem, size_t cItems, FILE *pFile);
    6276int     RT_NOCRT(fgetc)(FILE *pFile);
     
    6478int     RT_NOCRT(ferror)(FILE *pFile);
    6579void    RT_NOCRT(clearerr)(FILE *pFile);
     80int     RT_NOCRT(remove)(const char *pszFilename);
     81int     RT_NOCRT(sscanf)(const char *pszString, const char *pszFormat, ...);
     82
    6683# ifndef RT_NOCRT_EOF /* also in string */
    6784#  define RT_NOCRT_EOF  (-1)
     
    8198FILE   *RT_NOCRT(_fopen)(const char *pszFilename, const char *pszMode);
    8299FILE   *RT_NOCRT(_fdopen)(int fd, const char *pszMode);
     100FILE   *RT_NOCRT(_tmpfile)(void);
     101errno_t RT_NOCRT(_tmpfile_s)(FILE **ppFile);
     102int     RT_NOCRT(_fileno)(FILE *pFile);
    83103int     RT_NOCRT(_fclose)(FILE *pFile);
    84104int     RT_NOCRT(_fflush)(FILE *pFile);
    85105int     RT_NOCRT(_setvbuf)(FILE *pFile, char *pchBuf, int iBufferingType, size_t cbBuf);
     106int     RT_NOCRT(_fseek)(FILE *pFile, long, int);
     107int     RT_NOCRT(_fseeko)(FILE *pFile, off_t, int);
     108long    RT_NOCRT(_ftell)(FILE *pFile);
     109off_t   RT_NOCRT(_ftello)(FILE *pFile);
     110size_t  RT_NOCRT(_fwrite)(void const *pvBuf, size_t cbItem, size_t cItems, FILE *pFile);
     111int     RT_NOCRT(_fputs)(const char *psz, FILE *pFile);
     112int     RT_NOCRT(_fputc)(int, FILE *pFile);
    86113size_t  RT_NOCRT(_fread)(void *pvBuf, size_t cbItem, size_t cItems, FILE *pFile);
    87 size_t  RT_NOCRT(_fwrite)(void const *pvBuf, size_t cbItem, size_t cItems, FILE *pFile);
    88114int     RT_NOCRT(_fgetc)(FILE *pFile);
    89115int     RT_NOCRT(_getc)(FILE *pFile);
    90116int     RT_NOCRT(_ferror)(FILE *pFile);
    91117void    RT_NOCRT(_clearerr)(FILE *pFile);
     118int     RT_NOCRT(_remove)(const char *pszFilename);
     119int     RT_NOCRT(_sscanf)(const char *pszString, const char *pszFormat, ...);
    92120
    93121# define _IONBF         (1) /**< No buffering. */
     
    97125/* Aliases: */
    98126# if !defined(RT_WITHOUT_NOCRT_WRAPPERS) && !defined(RT_WITHOUT_NOCRT_WRAPPER_ALIASES)
    99 #  define snprintf   RT_NOCRT(snprintf)
    100 #  define vsnprintf  RT_NOCRT(vsnprintf)
    101 #  define scprintf   RT_NOCRT(scprintf)
    102 #  define vscprintf  RT_NOCRT(vscprintf)
     127#  define snprintf       RT_NOCRT(snprintf)
     128#  define vsnprintf      RT_NOCRT(vsnprintf)
     129#  define scprintf       RT_NOCRT(scprintf)
     130#  define vscprintf      RT_NOCRT(vscprintf)
    103131
    104 #  define fopen      RT_NOCRT(fopen)
    105 #  define fdopen     RT_NOCRT(fdopen)
    106 #  define fclose     RT_NOCRT(fclose)
    107 #  define fflush     RT_NOCRT(fflush)
    108 #  define setvbuf    RT_NOCRT(setvbuf)
    109 #  define fread      RT_NOCRT(fread)
    110 #  define fwrite     RT_NOCRT(fwrite)
    111 #  define fgetc      RT_NOCRT(fgetc)
    112 #  define getc       RT_NOCRT(getc)
    113 #  define ferror     RT_NOCRT(ferror)
    114 #  define clearerr   RT_NOCRT(clearerr)
     132#  define fopen          RT_NOCRT(fopen)
     133#  define fdopen         RT_NOCRT(fdopen)
     134#  define tmpfile        RT_NOCRT(tmpfile)
     135#  define tmpfile_s      RT_NOCRT(tmpfile_s)
     136#  define fileno         RT_NOCRT(fileno)
     137#  define fclose         RT_NOCRT(fclose)
     138#  define fflush         RT_NOCRT(fflush)
     139#  define setvbuf        RT_NOCRT(setvbuf)
     140#  define fseek          RT_NOCRT(fseek)
     141#  define fseeko         RT_NOCRT(fseeko)
     142#  define ftell          RT_NOCRT(ftell)
     143#  define ftello         RT_NOCRT(ftello)
     144#  define fwrite         RT_NOCRT(fwrite)
     145#  define fputs          RT_NOCRT(fputs)
     146#  define fputc          RT_NOCRT(fputc)
     147#  define fread          RT_NOCRT(fread)
     148#  define fgetc          RT_NOCRT(fgetc)
     149#  define getc           RT_NOCRT(getc)
     150#  define ferror         RT_NOCRT(ferror)
     151#  define clearerr       RT_NOCRT(clearerr)
     152#  define remove         RT_NOCRT(remove)
     153#  define sscanf         RT_NOCRT(sscanf)
    115154
    116155
    117156/* Underscored variants: */
    118 #  define _snprintf  RT_NOCRT(snprintf)
    119 #  define _vsnprintf RT_NOCRT(vsnprintf)
    120 #  define _scprintf  RT_NOCRT(scprintf)
    121 #  define _vscprintf RT_NOCRT(vscprintf)
     157#  define _snprintf      RT_NOCRT(snprintf)
     158#  define _vsnprintf     RT_NOCRT(vsnprintf)
     159#  define _scprintf      RT_NOCRT(scprintf)
     160#  define _vscprintf     RT_NOCRT(vscprintf)
    122161
    123 #  define _fopen     RT_NOCRT(fopen)
    124 #  define _fdopen    RT_NOCRT(fdopen)
    125 #  define _fclose    RT_NOCRT(fclose)
    126 #  define _flush     RT_NOCRT(fflush)
    127 #  define _setvbuf   RT_NOCRT(setvbuf)
    128 #  define _fread     RT_NOCRT(fread)
    129 #  define _fwrite    RT_NOCRT(fwrite)
    130 #  define _fgetc     RT_NOCRT(fgetc)
    131 #  define _getc      RT_NOCRT(getc)
    132 #  define _ferror    RT_NOCRT(ferror)
    133 #  define _clearerr  RT_NOCRT(clearerr)
     162#  define _fopen         RT_NOCRT(fopen)
     163#  define _fdopen        RT_NOCRT(fdopen)
     164#  define _tmpfile       RT_NOCRT(tmpfile)
     165#  define _tmpfile_s     RT_NOCRT(tmpfile_s)
     166#  define _fileno        RT_NOCRT(fileno)
     167#  define _fclose        RT_NOCRT(fclose)
     168#  define _flush         RT_NOCRT(fflush)
     169#  define _setvbuf       RT_NOCRT(setvbuf)
     170#  define _fseek         RT_NOCRT(fseek)
     171#  define _fseeko        RT_NOCRT(fseeko)
     172#  define _ftell         RT_NOCRT(ftell)
     173#  define _ftello        RT_NOCRT(ftello)
     174#  define _fwrite        RT_NOCRT(fwrite)
     175#  define _fputs         RT_NOCRT(fputs)
     176#  define _fputc         RT_NOCRT(fputc)
     177#  define _fread         RT_NOCRT(fread)
     178#  define _fgetc         RT_NOCRT(fgetc)
     179#  define _getc          RT_NOCRT(getc)
     180#  define _ferror        RT_NOCRT(ferror)
     181#  define _clearerr      RT_NOCRT(clearerr)
     182#  define _remove        RT_NOCRT(remove)
     183#  define _sscanf        RT_NOCRT(_sscanf)
    134184# endif
     185
     186RT_C_DECLS_END
    135187
    136188#endif
  • trunk/include/iprt/nocrt/stdlib.h

    r95975 r96013  
    8585}
    8686
     87int         RT_NOCRT(abs)(int);
     88long        RT_NOCRT(labs)(long);
     89long        RT_NOCRT(labs)(long);
     90long long   RT_NOCRT(llabs)(long long);
     91int         RT_NOCRT(rand)(void);
     92void        RT_NOCRT(srand)(unsigned);
     93long        RT_NOCRT(strtol)(const char *psz, char **ppszNext, int iBase);
     94long long   RT_NOCRT(strtoll)(const char *psz, char **ppszNext, int iBase);
     95unsigned long RT_NOCRT(strtoul)(const char *psz, char **ppszNext, int iBase);
     96unsigned long long RT_NOCRT(strtoull)(const char *psz, char **ppszNext, int iBase);
     97int         RT_NOCRT(atoi)(const char *psz);
     98double      RT_NOCRT(strtod)(const char *psz, char **ppszNext);
     99double      RT_NOCRT(atof)(const char *psz);
    87100void       *RT_NOCRT(bsearch)(const void *pvKey, const void *pvBase, size_t cEntries, size_t cbEntry,
    88101                              int (*pfnCompare)(const void *pv1, const void *pv2));
     
    124137}
    125138
     139int         RT_NOCRT(_abs)(int);
     140long        RT_NOCRT(_labs)(long);
     141long        RT_NOCRT(_labs)(long);
     142long long   RT_NOCRT(_llabs)(long long);
     143int         RT_NOCRT(_rand)(void);
     144void        RT_NOCRT(_srand)(unsigned);
     145long        RT_NOCRT(_strtol)(const char *psz, char **ppszNext, int iBase);
     146long long   RT_NOCRT(_strtoll)(const char *psz, char **ppszNext, int iBase);
     147unsigned long RT_NOCRT(_strtoul)(const char *psz, char **ppszNext, int iBase);
     148unsigned long long RT_NOCRT(_strtoull)(const char *psz, char **ppszNext, int iBase);
     149int         RT_NOCRT(_atoi)(const char *psz);
     150double      RT_NOCRT(_strtod)(const char *psz, char **ppszNext);
     151double      RT_NOCRT(_atof)(const char *psz);
    126152void       *RT_NOCRT(_bsearch)(const void *pvKey, const void *pvBase, size_t cEntries, size_t cbEntry,
    127153                               int (*pfnCompare)(const void *pv1, const void *pv2));
     
    143169 */
    144170# if !defined(RT_WITHOUT_NOCRT_WRAPPERS) && !defined(RT_WITHOUT_NOCRT_WRAPPER_ALIASES)
    145 #  define malloc    RT_NOCRT(malloc)
    146 #  define calloc    RT_NOCRT(calloc)
    147 #  define realloc   RT_NOCRT(realloc)
    148 #  define free      RT_NOCRT(free)
    149 #  define getenv    RT_NOCRT(getenv)
    150 #  define bsearch   RT_NOCRT(bsearch)
    151 #  define exit      RT_NOCRT(exit)
    152 #  define abort     RT_NOCRT(abort)
    153 
    154 #  define _malloc   RT_NOCRT(malloc)
    155 #  define _calloc   RT_NOCRT(calloc)
    156 #  define _realloc  RT_NOCRT(realloc)
    157 #  define _free     RT_NOCRT(free)
    158 #  define _getenv   RT_NOCRT(getenv)
    159 #  define _bsearch  RT_NOCRT(bsearch)
    160 #  define _exit     RT_NOCRT(exit)
    161 #  define _abort    RT_NOCRT(abort)
    162 # endif
     171#  define malloc        RT_NOCRT(malloc)
     172#  define calloc        RT_NOCRT(calloc)
     173#  define realloc       RT_NOCRT(realloc)
     174#  define free          RT_NOCRT(free)
     175#  define getenv        RT_NOCRT(getenv)
     176#  define bsearch       RT_NOCRT(bsearch)
     177#  define exit          RT_NOCRT(exit)
     178#  define abort         RT_NOCRT(abort)
     179#  define rand          RT_NOCRT(rand)
     180#  define srand         RT_NOCRT(srand)
     181#  define strtol        RT_NOCRT(strtol)
     182#  define strtoll       RT_NOCRT(strtoll)
     183#  define strtoul       RT_NOCRT(strtoul)
     184#  define strtoull      RT_NOCRT(strtoull)
     185#  define atoi          RT_NOCRT(atoi)
     186#  define strtod        RT_NOCRT(strtod)
     187#  define atof          RT_NOCRT(atof)
     188
     189#  define _malloc       RT_NOCRT(malloc)
     190#  define _calloc       RT_NOCRT(calloc)
     191#  define _realloc      RT_NOCRT(realloc)
     192#  define _free         RT_NOCRT(free)
     193#  define _getenv       RT_NOCRT(getenv)
     194#  define _bsearch      RT_NOCRT(bsearch)
     195#  define _exit         RT_NOCRT(exit)
     196#  define _abort        RT_NOCRT(abort)
     197#  define _strtol       RT_NOCRT(strtol)
     198#  define _strtoll      RT_NOCRT(strtoll)
     199#  define _strtoul      RT_NOCRT(strtoul)
     200#  define _strtoull     RT_NOCRT(strtoull)
     201#  define _atoi         RT_NOCRT(atoi)
     202#  define _strtod       RT_NOCRT(strtod)
     203#  define _atof         RT_NOCRT(atof)
     204#  endif
    163205
    164206#endif /* IPRT_NO_CRT_FOR_3RD_PARTY */
  • trunk/include/iprt/nocrt/string.h

    r95985 r96013  
    7777#endif
    7878size_t      RT_NOCRT(strxfrm)(char *pszDst, const char *pszSrc, size_t cch);
    79 long        RT_NOCRT(strtol)(const char *pszDst, char **ppszNext, int iBase);
    80 long long   RT_NOCRT(strtoll)(const char *pszDst, char **ppszNext, int iBase);
    81 unsigned long RT_NOCRT(strtoul)(const char *pszDst, char **ppszNext, int iBase);
    82 unsigned long long RT_NOCRT(strtoull)(const char *pszDst, char **ppszNext, int iBase);
    8379
    8480size_t      RT_NOCRT(wcslen)(const wchar_t *pwsz);
    8581wchar_t    *RT_NOCRT(wcscat)(wchar_t *pwszDst, const wchar_t *pwszSrc);
    86 wchar_t    *RT_NOCRT(wcschr)(const wchar_t *pwszDst, wchar_t wc);
     82wchar_t    *RT_NOCRT(wcschr)(const wchar_t *pwsz, wchar_t wc);
    8783wchar_t    *RT_NOCRT(wcscpy)(wchar_t *pwszDst, const wchar_t *pwszSrc);
    8884int         RT_NOCRT(wcsicmp)(const wchar_t *pwsz1, const wchar_t *pwsz2);
     
    128124#endif
    129125size_t      RT_NOCRT(_strxfrm)(char *pszDst, const char *pszSrc, size_t cch);
    130 long        RT_NOCRT(_strtol)(const char *pszDst, char **ppszNext, int iBase);
    131 long long   RT_NOCRT(_strtoll)(const char *pszDst, char **ppszNext, int iBase);
    132 unsigned long RT_NOCRT(_strtoul)(const char *pszDst, char **ppszNext, int iBase);
    133 unsigned long long RT_NOCRT(_strtoull)(const char *pszDst, char **ppszNext, int iBase);
    134126
    135127size_t      RT_NOCRT(_wcslen)(const wchar_t *pwsz);
    136128wchar_t    *RT_NOCRT(_wcscat)(wchar_t *pwszDst, const wchar_t *pwszSrc);
    137 wchar_t    *RT_NOCRT(_wcschr)(const wchar_t *pwszDst, wchar_t wc);
     129wchar_t    *RT_NOCRT(_wcschr)(const wchar_t *pwsz, wchar_t wc);
    138130wchar_t    *RT_NOCRT(_wcscpy)(wchar_t *pwszDst, const wchar_t *pwszSrc);
    139131int         RT_NOCRT(_wcsicmp)(const wchar_t *pwsz1, const wchar_t *pwsz2);
     
    174166# define strtok_s       RT_NOCRT(strtok_s)
    175167# define strxfrm        RT_NOCRT(strxfrm)
    176 # define strtol         RT_NOCRT(strtol)
    177 # define strtoll        RT_NOCRT(strtoll)
    178 # define strtoul        RT_NOCRT(strtoul)
    179 # define strtoull       RT_NOCRT(strtoull)
    180168
    181169# define wcslen         RT_NOCRT(wcslen)
     
    219207# define _strtok_s      RT_NOCRT(strtok_s)
    220208# define _strxfrm       RT_NOCRT(strxfrm)
    221 # define _strtol        RT_NOCRT(strtol)
    222 # define _strtoll       RT_NOCRT(strtoll)
    223 # define _strtoul       RT_NOCRT(strtoul)
    224 # define _strtoull      RT_NOCRT(strtoull)
    225209
    226210# define _wcslen        RT_NOCRT(wcslen)
  • trunk/include/iprt/nocrt/sys/stat.h

    r95976 r96013  
    3030#endif
    3131
     32#include <iprt/nocrt/time.h>    /* Establish timespec and timeval before iprt/fs.h includes iprt/time.h. */
    3233#include <iprt/fs.h>
    33 #include <sys/types.h>
    34 #include <time.h>
    35 #include <limits.h>
     34#include <iprt/nocrt/sys/types.h>
     35#include <iprt/nocrt/limits.h>
    3636
    3737#ifdef IPRT_NO_CRT_FOR_3RD_PARTY
     
    9393int     RT_NOCRT(stat)(const  char *pszPath, struct RT_NOCRT(stat) *pStat);
    9494RTFMODE RT_NOCRT(umask)(RTFMODE fMode);
     95int     RT_NOCRT(mkdir)(const char *, RTFMODE fMode);
    9596
    9697int     RT_NOCRT(_chmod)(const char *pszPath, RTFMODE fMode);
     
    100101int     RT_NOCRT(_stat)(const  char *pszPath, struct RT_NOCRT(stat) *pStat);
    101102RTFMODE RT_NOCRT(_umask)(RTFMODE fMode);
     103int     RT_NOCRT(_mkdir)(const char *, RTFMODE fMode);
    102104
    103105# if !defined(RT_WITHOUT_NOCRT_WRAPPERS) && !defined(RT_WITHOUT_NOCRT_WRAPPER_ALIASES)
     
    108110#  define stat       RT_NOCRT(stat)
    109111#  define umask      RT_NOCRT(umask)
     112#  define mkdir      RT_NOCRT(mkdir)
    110113
    111 #  define _chmod     RT_NOCRT(_chmod)
    112 #  define _fchmod    RT_NOCRT(_fchmod)
    113 #  define _fstat     RT_NOCRT(_fstat)
    114 #  define _lstat     RT_NOCRT(_lstat)
    115 #  define _stat      RT_NOCRT(_stat)
    116 #  define _umask     RT_NOCRT(_umask)
     114#  define _chmod     RT_NOCRT(chmod)
     115#  define _fchmod    RT_NOCRT(fchmod)
     116#  define _fstat     RT_NOCRT(fstat)
     117#  define _lstat     RT_NOCRT(lstat)
     118#  define _stat      RT_NOCRT(stat)
     119#  define _umask     RT_NOCRT(umask)
     120#  define _mkdir     RT_NOCRT(mkdir)
    117121# endif
    118122
  • trunk/include/iprt/nocrt/sys/types.h

    r95996 r96013  
    3232#include <iprt/types.h>
    3333
    34 typedef RTDEV   dev_t;
    35 typedef RTINODE ino_t;
    36 typedef int     errno_t;
     34typedef RTDEV       dev_t;
     35typedef int         errno_t;
     36typedef RTINODE     ino_t;
     37typedef RTFOFF      off_t;
     38typedef RTPROCESS   pid_t;
    3739
    3840#endif /* !IPRT_INCLUDED_nocrt_sys_types_h */
  • trunk/include/iprt/nocrt/time.h

    r95996 r96013  
    3030#endif
    3131
     32#define RTTIME_INCL_TIMESPEC
     33/*#define RTTIME_INCL_TIMEVAL*/
    3234#include <iprt/types.h>
    3335#include <iprt/nocrt/sys/types.h>
     
    5759RT_C_DECLS_BEGIN
    5860
     61time_t     RT_NOCRT(time)(time_t *);
    5962errno_t    RT_NOCRT(localtime_s)(struct tm *, const time_t *); /* The Microsoft version, not the C11 one. */
    6063struct tm *RT_NOCRT(localtime_r)(const time_t *, struct tm *);
    6164
     65time_t     RT_NOCRT(_time)(time_t *);
    6266errno_t    RT_NOCRT(_localtime_s)(struct tm *, const time_t *);
    6367struct tm *RT_NOCRT(_localtime_r)(const time_t *, struct tm *);
    6468
    6569# if !defined(RT_WITHOUT_NOCRT_WRAPPERS) && !defined(RT_WITHOUT_NOCRT_WRAPPER_ALIASES)
     70#  define time              RT_NOCRT(time)
    6671#  define localtime_s       RT_NOCRT(localtime_s)
    6772#  define localtime_r       RT_NOCRT(localtime_r)
    6873
     74#  define _time             RT_NOCRT(time)
    6975#  define _localtime_s      RT_NOCRT(localtime_s)
    7076#  define _localtime_r      RT_NOCRT(localtime_r)
     
    7379RT_C_DECLS_END
    7480
     81#ifdef IPRT_INCLUDED_time_h
     82# error nocrt/time.h after time.h
     83#endif
    7584
    7685#endif /* !IPRT_INCLUDED_nocrt_time_h */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette