Changeset 936 for cpp


Ignore:
Timestamp:
05/30/20 20:25:42 (2 months ago)
Author:
Maciej Komosinski
Message:

Supported qsort_r()/qsort_s() in Borland/Embarcadero? compiler

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/common/nonstd.h

    r931 r936  
    4646#endif
    4747
    48 #if defined MACOS || defined __ANDROID__ || defined IPHONE
     48#if defined(MACOS) || defined(__ANDROID__) || defined(IPHONE)
    4949 #define stricmp(a,b) strcasecmp(a,b)
    5050 #define strnicmp(a,b,c) strncasecmp(a,b,c)
     
    5555//typedef char byte; //rozne srodowiska c++ definiuja byte jako unsigned char! w javie jest inaczej -> trzeba i tak zmienic w portowanych zrodlach byte na char.
    5656
     57//How cool, gcc&clang: qsort_r(a,b), borland: qsort_s(a,b), visual: qsort_s(b,a)
     58#ifdef __BORLANDC__
     59 #define qsort_r qsort_s
     60#endif
     61
    5762#ifdef _MSC_VER
    58 #define QSORT_R_USING_QSORT_S //qsort_r callers use this macro to adjust argument order in comparator, because microsoft and gcc/clang are incompatible here
    59 #define qsort_r(base,nmemb,size,compar,context) qsort_s((base),(nmemb),(size),(compar),(context))
     63 #define QSORT_R_USING_QSORT_S //qsort_r callers use this macro to adjust argument order in comparator, because microsoft and gcc&clang are incompatible here
     64 #define qsort_r(base,nmemb,size,compar,context) qsort_s((base),(nmemb),(size),(compar),(context))
    6065#endif
    6166
Note: See TracChangeset for help on using the changeset viewer.