--- mstools/h/search.h 2018/08/09 18:20:01 1.1.1.1 +++ mstools/h/search.h 2018/08/09 18:21:02 1.1.1.3 @@ -1,7 +1,7 @@ /*** *search.h - declarations for searcing/sorting routines * -* Copyright (c) 1985-1991, Microsoft Corporation. All rights reserved. +* Copyright (c) 1985-1992, Microsoft Corporation. All rights reserved. * *Purpose: * This file contains the declarations for the sorting and @@ -17,10 +17,38 @@ extern "C" { #endif -#if (_MSC_VER <= 600) -#define __cdecl _cdecl +/* + * Conditional macro definition for function calling type and variable type + * qualifiers. + */ +#if ( (_MSC_VER >= 800) && (_M_IX86 >= 300) ) + +/* + * Definitions for MS C8-32 (386/486) compiler + */ +#define _CRTAPI1 __cdecl +#define _CRTAPI2 __cdecl + +#elif ( _MSC_VER == 600 ) + +/* + * Definitions for old MS C6-386 compiler + */ +#define _CRTAPI1 _cdecl +#define _CRTAPI2 _cdecl +#define _M_IX86 300 + +#else + +/* + * Other compilers (e.g., MIPS) + */ +#define _CRTAPI1 +#define _CRTAPI2 + #endif + #ifndef _SIZE_T_DEFINED typedef unsigned int size_t; #define _SIZE_T_DEFINED @@ -29,13 +57,13 @@ typedef unsigned int size_t; /* function prototypes */ -void * bsearch(const void *, const void *, size_t, size_t, - int (*)(const void *, const void *)); -void * _lfind(const void *, const void *, unsigned int *, unsigned int, - int (*)(const void *, const void *)); -void * _lsearch(const void *, void *, unsigned int *, unsigned int, - int (*)(const void *, const void *)); -void qsort(void *, size_t, size_t, int (*)(const void *, +void * _CRTAPI1 bsearch(const void *, const void *, size_t, size_t, + int (_CRTAPI1 *)(const void *, const void *)); +void * _CRTAPI1 _lfind(const void *, const void *, unsigned int *, unsigned int, + int (_CRTAPI1 *)(const void *, const void *)); +void * _CRTAPI1 _lsearch(const void *, void *, unsigned int *, unsigned int, + int (_CRTAPI1 *)(const void *, const void *)); +void _CRTAPI1 qsort(void *, size_t, size_t, int (_CRTAPI1 *)(const void *, const void *)); #if !__STDC__