Changeset 10005 for trunk/src/msvcrt/misc.c
- Timestamp:
- Apr 10, 2003, 12:28:07 PM (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/msvcrt/misc.c
r9633 r10005 21 21 #include "msvcrt.h" 22 22 #include <stdlib.h> 23 23 #include <string.h> 24 #include <math.h> 25 #include "emxheader.h" 24 26 #include "msvcrt/stdlib.h" 25 27 … … 50 52 * _sleep (MSVCRT.@) 51 53 */ 52 void _sleep(unsigned long timeout)54 void MSVCRT__sleep(unsigned long timeout) 53 55 { 54 56 TRACE("_sleep for %ld milliseconds\n",timeout); … … 59 61 * _lfind (MSVCRT.@) 60 62 */ 61 void* _lfind(const void* match, const void* start,63 void* MSVCRT__lfind(const void* match, const void* start, 62 64 unsigned int* array_size, unsigned int elem_size, 63 65 MSVCRT_compar_fn_t cf) 64 66 { 65 67 unsigned int size = *array_size; 68 dprintf(("MSVCRT: _lfind")); 66 69 if (size) 67 70 do … … 77 80 * _lsearch (MSVCRT.@) 78 81 */ 79 void* _lsearch(const void* match, void* start,82 void* MSVCRT__lsearch(const void* match, void* start, 80 83 unsigned int* array_size, unsigned int elem_size, 81 84 MSVCRT_compar_fn_t cf) 82 85 { 83 86 unsigned int size = *array_size; 87 dprintf(("MSVCRT: _lsearch")); 84 88 if (size) 85 89 do … … 96 100 } 97 101 102 98 103 /********************************************************************* 99 104 * _chkesp (MSVCRT.@) 105 * 106 * Trap to a debugger if the value of the stack pointer has changed. 107 * 108 * PARAMS 109 * None. 110 * 111 * RETURNS 112 * Does not return. 113 * 114 * NOTES 115 * This function is available for iX86 only. 116 * 117 * When VC++ generates debug code, it stores the value of the stack pointer 118 * before calling any external function, and checks the value following 119 * the call. It then calls this function, which will trap if the values are 120 * not the same. Usually this means that the prototype used to call 121 * the function is incorrect. It can also mean that the .spec entry has 122 * the wrong calling convention or parameters. 100 123 */ 101 void _chkesp(void) 124 #ifdef __i386__ 125 126 # ifdef __GNUC__ 127 __ASM_GLOBAL_FUNC(_chkesp, 128 "jnz 1f\n\t" 129 "ret\n" 130 "1:\tpushl %ebp\n\t" 131 "movl %esp,%ebp\n\t" 132 "pushl %eax\n\t" 133 "pushl %ecx\n\t" 134 "pushl %edx\n\t" 135 "call " __ASM_NAME("MSVCRT_chkesp_fail") "\n\t" 136 "popl %edx\n\t" 137 "popl %ecx\n\t" 138 "popl %eax\n\t" 139 "popl %ebp\n\t" 140 "ret"); 141 142 void MSVCRT_chkesp_fail(void) 102 143 { 144 ERR("Stack pointer incorrect after last function call - Bad prototype/spec entry?\n"); 145 DebugBreak(); 146 } 103 147 104 } 148 # else /* __GNUC__ */ 149 void _chkesp(void) { } 150 # endif /* __GNUC__ */ 151 152 #endif /* __i386__ */ 153 154 105 155 106 156 #ifdef __WIN32OS2__ … … 116 166 * [GNUC && i386] 117 167 */ 168 double _emx_rint (double); 169 118 170 #if defined(__GNUC__) && defined(__i386__) 119 LONG __cdecl _ftol(void)171 LONGLONG __cdecl _ftol(double fl) 120 172 { 121 173 /* don't just do DO_FPU("fistp",retval), because the rounding 122 174 * mode must also be set to "round towards zero"... */ 123 double fl;124 175 POP_FPU(fl); 125 return (LONG)fl; 176 return (LONGLONG)(fl); 177 126 178 } 127 179 #endif /* defined(__GNUC__) && defined(__i386__) */
Note:
See TracChangeset
for help on using the changeset viewer.