redefined MEM macros
This commit is contained in:
		| @ -315,6 +315,7 @@ static int pro_on_read (mio_dev_pro_t* pro, mio_dev_pro_sid_t sid, const void* d | ||||
| static int pro_on_write (mio_dev_pro_t* pro, mio_iolen_t wrlen, void* wrctx) | ||||
| { | ||||
| 	mio_t* mio = pro->mio; | ||||
| 	mio_ntime_t tmout; | ||||
| 	if (wrlen <= -1) | ||||
| 	{ | ||||
| 		MIO_INFO1 (mio, "PROCESS(%d): WRITE TIMED OUT...\n", (int)pro->child_pid); | ||||
| @ -323,7 +324,9 @@ static int pro_on_write (mio_dev_pro_t* pro, mio_iolen_t wrlen, void* wrctx) | ||||
| 	} | ||||
|  | ||||
| 	MIO_DEBUG2 (mio, "PROCESS(%d) wrote data of %d bytes\n", (int)pro->child_pid, (int)wrlen); | ||||
| 	mio_dev_pro_read (pro, MIO_DEV_PRO_OUT, 1); | ||||
| 	/*mio_dev_pro_read (pro, MIO_DEV_PRO_OUT, 1);*/ | ||||
| 	MIO_INIT_NTIME (&tmout, 5, 0); | ||||
| 	mio_dev_pro_timedread (pro, MIO_DEV_PRO_OUT, 1, &tmout); | ||||
| 	return 0; | ||||
| } | ||||
|  | ||||
|  | ||||
| @ -31,12 +31,61 @@ | ||||
| #include "mio-utl.h" | ||||
| #include <stdarg.h> | ||||
|  | ||||
| /*TODO: redefine and remove these */ | ||||
| #include <string.h> | ||||
| #define MIO_MEMSET(dst,byte,count) memset(dst,byte,count) | ||||
| #define MIO_MEMCPY(dst,src,count) memcpy(dst,src,count) | ||||
| #define MIO_MEMMOVE(dst,src,count) memmove(dst,src,count) | ||||
| #define MIO_MEMCMP(dst,src,count) memcmp(dst,src,count) | ||||
| #if defined(__has_builtin) | ||||
|  | ||||
| #	if (!__has_builtin(__builtin_memset) || !__has_builtin(__builtin_memcpy) || !__has_builtin(__builtin_memmove) || !__has_builtin(__builtin_memcmp)) | ||||
| #	include <string.h> | ||||
| #	endif | ||||
|  | ||||
| #	if __has_builtin(__builtin_memset) | ||||
| #		define MIO_MEMSET(dst,src,size)  __builtin_memset(dst,src,size) | ||||
| #	else | ||||
| #		define MIO_MEMSET(dst,src,size)  memset(dst,src,size) | ||||
| #	endif | ||||
| #	if __has_builtin(__builtin_memcpy) | ||||
| #		define MIO_MEMCPY(dst,src,size)  __builtin_memcpy(dst,src,size) | ||||
| #	else | ||||
| #		define MIO_MEMCPY(dst,src,size)  memcpy(dst,src,size) | ||||
| #	endif | ||||
| #	if __has_builtin(__builtin_memmove) | ||||
| #		define MIO_MEMMOVE(dst,src,size)  __builtin_memmove(dst,src,size) | ||||
| #	else | ||||
| #		define MIO_MEMMOVE(dst,src,size)  memmove(dst,src,size) | ||||
| #	endif | ||||
| #	if __has_builtin(__builtin_memcmp) | ||||
| #		define MIO_MEMCMP(dst,src,size)  __builtin_memcmp(dst,src,size) | ||||
| #	else | ||||
| #		define MIO_MEMCMP(dst,src,size)  memcmp(dst,src,size) | ||||
| #	endif | ||||
|  | ||||
| #else | ||||
|  | ||||
| #	if defined(HAVE___BUILTIN_MEMSET) || !defined(HAVE___BUILTIN_MEMCPY) || !defined(HAVE___BUILTIN_MEMMOVE) || !defined(HAVE___BUILTIN_MEMCMP) | ||||
| #	include <string.h> | ||||
| #	endif | ||||
|  | ||||
| #	if defined(HAVE___BUILTIN_MEMSET) | ||||
| #		define MIO_MEMSET(dst,src,size)  __builtin_memset(dst,src,size) | ||||
| #	else | ||||
| #		define MIO_MEMSET(dst,src,size)  memset(dst,src,size) | ||||
| #	endif | ||||
| #	if defined(HAVE___BUILTIN_MEMCPY) | ||||
| #		define MIO_MEMCPY(dst,src,size)  __builtin_memcpy(dst,src,size) | ||||
| #	else | ||||
| #		define MIO_MEMCPY(dst,src,size)  memcpy(dst,src,size) | ||||
| #	endif | ||||
| #	if defined(HAVE___BUILTIN_MEMMOVE) | ||||
| #		define MIO_MEMMOVE(dst,src,size)  __builtin_memmove(dst,src,size) | ||||
| #	else | ||||
| #		define MIO_MEMMOVE(dst,src,size)  memmove(dst,src,size) | ||||
| #	endif | ||||
| #	if defined(HAVE___BUILTIN_MEMCMP) | ||||
| #		define MIO_MEMCMP(dst,src,size)  __builtin_memcmp(dst,src,size) | ||||
| #	else | ||||
| #		define MIO_MEMCMP(dst,src,size)  memcmp(dst,src,size) | ||||
| #	endif | ||||
|  | ||||
| #endif | ||||
|  | ||||
| /* ========================================================================= | ||||
|  * MIO ASSERTION | ||||
|  | ||||
		Reference in New Issue
	
	Block a user