- Timestamp:
- 10/01/21 22:39:55 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
cpp/common/nonstd.h
r1016 r1154 57 57 //How cool, gcc&clang: qsort_r(a,b), borland: qsort_s(a,b), visual: qsort_s(b,a) 58 58 #ifdef __BORLANDC__ 59 #define qsort_r qsort_s 59 #define CALL_QSORT_R(base,nmemb,size,compar,context) qsort_s(base,nmemb,size,compar,context) 60 60 #endif 61 61 62 62 #ifdef _MSC_VER 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)) 63 #define QSORT_R_THIS_FIRST //qsort_r callers use this macro to adjust argument order in comparator, because microsoft and gcc&clang are incompatible here 64 #define CALL_QSORT_R(base,nmemb,size,compar,context) qsort_s((base),(nmemb),(size),(compar),(context)) 65 #endif 66 67 #if defined MACOS || defined IPHONE 68 //qsort_r(void *__base, size_t __nel, size_t __width, void *, int (* _Nonnull __compar)(void *, const void *, const void *)); 69 #define QSORT_R_THIS_FIRST 70 #define CALL_QSORT_R(base,nmemb,size,compar,context) qsort_r(base,nmemb,size,context,compar) 71 #endif 72 73 #ifndef CALL_QSORT_R 74 #define CALL_QSORT_R(base,nmemb,size,compar,context) qsort_r(base,nmemb,size,compar,context) 65 75 #endif 66 76
Note: See TracChangeset
for help on using the changeset viewer.