Changeset 0f9e4403 for src/libcfa/stdlib


Ignore:
Timestamp:
Apr 15, 2016, 12:03:11 PM (9 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, ctor, deferred_resn, demangler, enum, forall-pointer-decay, gc_noraii, jacob/cs343-translation, jenkins-sandbox, master, memory, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
29ad0ac
Parents:
c5833e8 (diff), 37f0da8 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' into gc_noraii

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/libcfa/stdlib

    rc5833e8 r0f9e4403  
    1010// Created On       : Thu Jan 28 17:12:35 2016
    1111// Last Modified By : Peter A. Buhr
    12 // Last Modified On : Fri Feb  5 15:21:18 2016
    13 // Update Count     : 61
     12// Last Modified On : Wed Apr 13 14:45:53 2016
     13// Update Count     : 85
    1414//
    1515
     
    2020} // extern "C"
    2121
    22 forall( type T ) T * memset( T * ptr, unsigned char fill ); // use default value '\0' for fill
    23 forall( type T ) T * memset( T * ptr );                                 // remove when default value available
     22//---------------------------------------
    2423
    25 forall( type T ) T * malloc( void );
    26 forall( type T ) T * malloc( char fill );
    27 forall( type T ) T * malloc( size_t size );
    28 forall( type T ) T * malloc( T * ptr, size_t size );
    29 forall( type T ) T * malloc( T * ptr, size_t size, unsigned char fill );
    30 forall( type T ) T * calloc( size_t size );
    31 forall( type T ) T * realloc( T * ptr, size_t size );
    32 forall( type T ) T * realloc( T * ptr, size_t size, unsigned char fill );
     24extern "C" {
     25#ifndef EXIT_FAILURE
     26#define EXIT_FAILURE    1                                                               // failing exit status
     27#define EXIT_SUCCESS    0                                                               // successful exit status
     28#endif // ! EXIT_FAILURE
     29void exit( int rc );
     30} // extern "C"
    3331
    34 forall( type T ) T * aligned_alloc( size_t alignment );
    35 forall( type T ) T * memalign( size_t alignment );              // deprecated
    36 forall( type T ) int posix_memalign( T ** ptr, size_t alignment );
     32//---------------------------------------
     33
     34extern "C" {
     35void * malloc( size_t );                                                                // use default C routine for void *
     36} // extern "C"
     37forall( otype T ) T * malloc( void );
     38forall( otype T ) T * malloc( char fill );
     39forall( otype T ) T * malloc( T * ptr, size_t size );
     40forall( otype T ) T * malloc( T * ptr, size_t size, unsigned char fill );
     41extern "C" {
     42void * calloc( size_t nmemb, size_t size );                             // use default C routine for void *
     43} // extern "C"
     44forall( otype T ) T * calloc( size_t nmemb );
     45extern "C" {
     46void * realloc( void * ptr, size_t size );                              // use default C routine for void *
     47} // extern "C"
     48forall( otype T ) T * realloc( T * ptr, size_t size );
     49forall( otype T ) T * realloc( T * ptr, size_t size, unsigned char fill );
     50
     51forall( otype T ) T * aligned_alloc( size_t alignment );
     52forall( otype T ) T * memalign( size_t alignment );             // deprecated
     53forall( otype T ) int posix_memalign( T ** ptr, size_t alignment );
     54
     55forall( otype T ) T * memset( T * ptr, unsigned char fill ); // use default value '\0' for fill
     56forall( otype T ) T * memset( T * ptr );                                // remove when default value available
    3757
    3858//---------------------------------------
     
    6686//---------------------------------------
    6787
    68 forall( type T | { int ?<?( T, T ); } )
     88forall( otype T | { int ?<?( T, T ); } )
    6989T * bsearch( const T key, const T * arr, size_t dimension );
    7090
    71 forall( type T | { int ?<?( T, T ); } )
     91forall( otype T | { int ?<?( T, T ); } )
    7292void qsort( const T * arr, size_t dimension );
    7393
    7494//---------------------------------------
    7595
    76 forall( type T | { T ?/?( T, T ); T ?%?( T, T ); } )
     96forall( otype T | { T ?/?( T, T ); T ?%?( T, T ); } )
    7797[ T, T ] div( T t1, T t2 );
    7898
     
    81101char abs( char );
    82102extern "C" {
    83 int abs( int );         // use default C routine for int
    84 } // extern
     103int abs( int );                                                                                 // use default C routine for int
     104} // extern "C"
    85105long int abs( long int );
    86106long long int abs( long long int );
     
    94114//---------------------------------------
    95115
    96 void randseed( long int s );
    97 char random();
    98 int random();
    99 unsigned int random();
    100 long int random();
    101 unsigned long int random();
    102 float random();
    103 double random();
    104 float _Complex random();
    105 double _Complex random();
    106 long double _Complex random();
     116float floor( float );
     117extern "C" {
     118double floor( double );                                                                 // use C routine for double
     119} // extern "C"
     120long double floor( long double );
     121
     122float ceil( float );
     123extern "C" {
     124double ceil( double );                                                                  // use C routine for double
     125} // extern "C"
     126long double ceil( long double );
    107127
    108128//---------------------------------------
    109129
    110 forall( type T | { int ?<?( T, T ); } )
     130void rand48seed( long int s );
     131char rand48();
     132int rand48();
     133unsigned int rand48();
     134long int rand48();
     135unsigned long int rand48();
     136float rand48();
     137double rand48();
     138float _Complex rand48();
     139double _Complex rand48();
     140long double _Complex rand48();
     141
     142//---------------------------------------
     143
     144forall( otype T | { int ?<?( T, T ); } )
    111145T min( const T t1, const T t2 );
    112146
    113 forall( type T | { int ?>?( T, T ); } )
     147forall( otype T | { int ?>?( T, T ); } )
    114148T max( const T t1, const T t2 );
    115149
    116 forall( type T )
     150forall( otype T )
    117151void swap( T * t1, T * t2 );
    118152
Note: See TracChangeset for help on using the changeset viewer.