Changeset 57

Show
Ignore:
Timestamp:
05/13/07 11:59:33 (2 years ago)
Author:
daboo
Message:

Fix some warnings and only define functions not already available on system.

Location:
Mulberry/trunk/Sources_Common/Utilities
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • Mulberry/trunk/Sources_Common/Utilities/CStringUtils.cp

    r19 r57  
    2424// S T R I N G  F U N C T I O N S 
    2525 
    26 #ifndef __GNUC__ 
     26#ifndef strdup 
    2727// Duplicate string 
    2828char* strdup(const char* s1) 
     
    3939#endif 
    4040 
     41#ifndef strndup 
    4142// Duplicate string a fixed length 
    4243char* strndup(const char* s1, size_t len) 
     
    5253                return NULL; 
    5354} 
     55#endif 
    5456 
    5557// Convert to lowercase 
     
    6062        if (s1) 
    6163                while(*s1) 
    62                         *s1++ = tolower(*s1); 
     64                { 
     65                        *s1 = tolower(*s1); 
     66                        s1++; 
     67                } 
    6368#else 
    6469        if (s1--) 
     
    7580        if (s1) 
    7681                while(*s1) 
    77                         *s1++ = toupper(*s1); 
     82                { 
     83                        *s1 = toupper(*s1); 
     84                        s1++; 
     85                } 
    7886#else 
    7987        if (s1--) 
  • Mulberry/trunk/Sources_Common/Utilities/CStringUtils.h

    r19 r57  
    5757                                                const char* tokens);    // Duplicate possibly quoted string without destroying end 
    5858 
    59 #ifndef __GNUC__ 
     59#ifndef strdup 
    6060char* strdup(const char* s1);                                   // Duplicate a string 
    6161#endif 
     62#ifndef strndup 
    6263char* strndup(const char* s1, size_t len);              // Duplicate len chars of string 
     64#endif 
    6365 
    6466void strlower(char* s1);                                                // Convert to lowercase