Changeset 37604 in webkit for trunk/JavaScriptCore


Ignore:
Timestamp:
Oct 15, 2008, 9:42:43 AM (17 years ago)
Author:
Darin Adler
Message:

2008-10-15 Joerg Bornemann <[email protected]>

Reviewed by Darin Adler.

str(n)icmp, strdup and vsnprintf are not available on Windows CE,
they are called _str(n)icmp, etc. instead

  • wtf/StringExtras.h: Added inline function implementations.
Location:
trunk/JavaScriptCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r37602 r37604  
     12008-10-15  Joerg Bornemann  <[email protected]>
     2
     3        Reviewed by Darin Adler.
     4
     5        - part of https://bugs.webkit.org/show_bug.cgi?id=20746
     6          Fix compilation on Windows CE.
     7
     8        str(n)icmp, strdup and vsnprintf are not available on Windows CE,
     9        they are called _str(n)icmp, etc. instead
     10
     11        * wtf/StringExtras.h: Added inline function implementations.
     12
    1132008-10-15  Gabor Loki  <[email protected]>
    214
  • trunk/JavaScriptCore/wtf/StringExtras.h

    r36289 r37604  
    11/*
    2  * Copyright (C) 2006 Apple Computer, Inc. All rights reserved.
     2 * Copyright (C) 2006 Apple Inc. All rights reserved.
    33 *
    44 * Redistribution and use in source and binary forms, with or without
     
    2727#define WTF_StringExtras_h
    2828
     29#include <stdarg.h>
    2930#include <stdio.h>
    30 #include <stdarg.h>
    3131
    3232#if COMPILER(MSVC)
    3333
    34 inline int snprintf(char *str, size_t size, const char* format, ...)
     34inline int snprintf(char* buffer, size_t count, const char* format, ...)
    3535{
    3636    int result;
    3737    va_list args;
    3838    va_start(args, format);
    39     result = _vsnprintf(str, size, format, args);
     39    result = _vsnprintf(buffer, count, format, args);
    4040    va_end(args);
    4141    return result;
    4242}
    4343
    44 #if COMPILER(MSVC7)
    45 // MSVC8 and above define this function
    46 #define vsnprintf snprintf
     44#if COMPILER(MSVC7) || PLATFORM(WIN_CE)
     45
     46inline int vsnprintf(char* buffer, size_t count, const char* format, va_list args)
     47{
     48    return _vsnprintf(buffer, count, format, args);
     49}
     50
    4751#endif
    4852
    49 inline int strncasecmp(const char* s1, const char* s2, size_t len) { return strnicmp(s1, s2, len); }
     53#if PLATFORM(WIN_CE)
    5054
    51 inline int strcasecmp(const char* s1, const char* s2) { return stricmp(s1, s2); }
     55inline int strnicmp(const char* string1, const char* string2, size_t count)
     56{
     57    return _strnicmp(string1, string2, count);
     58}
     59
     60inline int stricmp(const char* string1, const char* string2)
     61{
     62    return _stricmp(string1, string2);
     63}
     64
     65inline char* strdup(const char* strSource)
     66{
     67    return _strdup(strSource);
     68}
     69
     70#endif
     71
     72inline int strncasecmp(const char* s1, const char* s2, size_t len)
     73{
     74    return strnicmp(s1, s2, len);
     75}
     76
     77inline int strcasecmp(const char* s1, const char* s2)
     78{
     79    return stricmp(s1, s2);
     80}
    5281
    5382#endif
Note: See TracChangeset for help on using the changeset viewer.