File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11#include "memory.h"
22
3- int memcmp (const void * s1 , const void * s2 , unsigned long count ) {
3+ int memcmp (const void * s1 , const void * s2 , size_t count ) {
44 const unsigned char * a = s1 ;
55 const unsigned char * b = s2 ;
6- for (unsigned long i = 0 ; i < count ; i ++ ) {
6+ for (size_t i = 0 ; i < count ; i ++ ) {
77 if (a [i ] != b [i ]) return a [i ] - b [i ];
88 }
99 return 0 ;
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ extern "C" {
44
55#include "types.h"
66
7- int memcmp (const void * s1 , const void * s2 , unsigned long count );
7+ int memcmp (const void * s1 , const void * s2 , size_t count );
88void * memset (void * dest , int byte , size_t count );
99void * memset32 (void * dest , uint32_t val , size_t count );
1010void * memcpy (void * dest , const void * src , uint64_t count );
Original file line number Diff line number Diff line change @@ -43,9 +43,15 @@ extern "C" {
4343} while(0)
4444
4545typedef unsigned int uint32_t ;
46- typedef long unsigned int size_t ;
47- typedef unsigned long uint64_t ;
48- typedef unsigned long uintptr_t ;
46+ #ifdef _WIN32
47+ typedef unsigned long long size_t ;
48+ typedef unsigned long long uint64_t ;
49+ typedef unsigned long long uintptr_t ;
50+ #else
51+ typedef unsigned long int size_t ;
52+ typedef unsigned long int uint64_t ;
53+ typedef unsigned long int uintptr_t ;
54+ #endif
4955typedef unsigned short uint16_t ;
5056typedef unsigned char uint8_t ;
5157
@@ -59,8 +65,13 @@ typedef unsigned char uint8_t;
5965#define N_ARR (arr ) (sizeof(arr)/sizeof((arr)[0]))
6066
6167typedef signed int int32_t ;
62- typedef signed long int64_t ;
63- typedef signed long intptr_t ;
68+ #ifdef _WIN32
69+ typedef signed long long int64_t ;
70+ typedef signed long long intptr_t ;
71+ #else
72+ typedef signed long int int64_t ;
73+ typedef signed long int intptr_t ;
74+ #endif
6475typedef signed short int16_t ;
6576typedef signed char int8_t ;
6677
You can’t perform that action at this time.
0 commit comments