Index: /trunk/include/cf_thread.h
===================================================================
--- /trunk/include/cf_thread.h	(revision 56)
+++ /trunk/include/cf_thread.h	(revision 57)
@@ -13,14 +13,6 @@
 #include "cf_base.h"
 
-#if defined(_WIN32) || defined(_WIN64)
-# define CF_THREAD_RETURN	unsigned int	/**< 스레드 워커 함수 반환 형 */
-# define CF_THREAD_CALL		__stdcall		/**< 스레드 워커 함수 호출 규약 */
-#else
-# define CF_THREAD_RETURN	void *			/**< 스레드 워커 함수 반환 형 */
-# define CF_THREAD_CALL						/**< 스레드 워커 함수 호출 규약 */
-#endif
-
 /** 스레드 워커 함수 형태이며, CF_Thread_Function 형식 */
-typedef CF_THREAD_RETURN  (CF_THREAD_CALL * CF_Thread_Function) (void *);
+typedef int (* CF_Thread_Function) (void *);
 
 /** 스레드 아이디 */
Index: /trunk/src/cf_thread.c
===================================================================
--- /trunk/src/cf_thread.c	(revision 56)
+++ /trunk/src/cf_thread.c	(revision 57)
@@ -15,8 +15,12 @@
 # define THREAD_TYPE	HANDLE
 # define MUTEX_TYPE		HANDLE
+# define THREAD_RETURN	unsigned long	/**< 스레드 워커 함수 반환 형 */
+# define THREAD_CALL	__stdcall
 #else // #if defined(_WIN32) || defined(_WIN64)
 # include <pthread.h>
 # define THREAD_TYPE	pthread_t
 # define MUTEX_TYPE		pthread_mutex_t
+# define THREAD_RETURN	void *			/**< 스레드 워커 함수 반환 형 */
+# define THREAD_CALL
 #endif // #if defined(_WIN32) || defined(_WIN64)
 
@@ -57,6 +61,9 @@
 	int result = 0;
 
-#if defined(_WIN32) || defined(_WIN64)
-	*threadID = (THREAD_TYPE) _beginthreadex (0, 0, callback, arg, 0, 0);
+	THREAD_RETURN THREAD_CALL f = (THREAD_RETURN THREAD_CALL) callback;
+
+#if defined(_WIN32) || defined(_WIN64)
+
+	*threadID = (THREAD_TYPE) CreateThread (NULL, 0, f, arg, 0, NULL);
 	if (*threadID == NULL)
 		return CF_ERROR_THREAD_CREATE;
@@ -66,5 +73,5 @@
 		return CF_ERROR_THREAD_CREATE;
 
-	result = pthread_create ((THREAD_TYPE *) *threadID, NULL, callback, arg);
+	result = pthread_create ((THREAD_TYPE *) *threadID, NULL, f, arg);
 	if (result < 0)
 		return CF_ERROR_THREAD_CREATE;
Index: /trunk/test/test.c
===================================================================
--- /trunk/test/test.c	(revision 56)
+++ /trunk/test/test.c	(revision 57)
@@ -29,5 +29,5 @@
 const char * file = "./log.txt";
 
-CF_THREAD_RETURN CF_THREAD_CALL test_log_mt (void * arg)
+int test_log_mt (void * arg)
 {
 	static int cnt = 0;
@@ -52,5 +52,5 @@
 	CF_DEBUG_PRINT (stderr, "end %dth thread\n", th);
 
-	return (CF_THREAD_RETURN)0;
+	return 0;
 }
 
@@ -171,5 +171,5 @@
 }
 
-CF_THREAD_RETURN CF_THREAD_CALL socket_echo_server (void * arg)
+int socket_echo_server (void * arg)
 {
 	int srvsock = *((int *)arg);
@@ -184,5 +184,5 @@
 	{
 		CF_DEBUG_PRINT (stderr, "failed to accept on server\n");
-		return (CF_THREAD_RETURN)-1;
+		return -1;
 	}
 	CF_Log_Write (LOG_SOCKET, "SERVER", "accepted\n");
@@ -193,5 +193,5 @@
 		{
 			CF_DEBUG_PRINT (stderr, "failed to recv on server\n");
-			return (CF_THREAD_RETURN)-2;
+			return -2;
 		}
 		CF_Log_Write (LOG_SOCKET, "SERVER", "recv {%s}\n", buf);
@@ -199,5 +199,5 @@
 		if (CF_Socket_Send (clntsock, buf, recvd) < 0)
 		{
-			return (CF_THREAD_RETURN)-3;
+			return -3;
 		}
 		CF_Log_Write (LOG_SOCKET, "SERVER", "resp {%s}\n", buf);
@@ -206,9 +206,9 @@
 	CF_Socket_Close (clntsock);
 
-	return (CF_THREAD_RETURN)0;
-	/*------------------------------------------------------------*/
-}
-
-CF_THREAD_RETURN CF_THREAD_CALL socket_echo_client (void * arg)
+	return 0;
+	/*------------------------------------------------------------*/
+}
+
+int socket_echo_client (void * arg)
 {
 	int sock = 0;
@@ -224,5 +224,5 @@
 	{
 		CF_DEBUG_PRINT (stderr, "failed to connect on client\n");
-		return (CF_THREAD_RETURN)-1;
+		return -1;
 	}
 	CF_Log_Write (LOG_SOCKET, "CLIENT", "connected\n");
@@ -233,5 +233,5 @@
 		{
 			CF_DEBUG_PRINT (stderr, "failed to send on client %d\n", errno);
-			return (CF_THREAD_RETURN)-2;
+			return -2;
 		}
 		CF_Log_Write (LOG_SOCKET, "CLIENT", "sent {%s}\n", buf);
@@ -242,5 +242,5 @@
 		{
 			CF_DEBUG_PRINT (stderr, "failed to recv on client\n");
-			return (CF_THREAD_RETURN)-3;
+			return -3;
 		}
 		CF_Log_Write (LOG_SOCKET, "CLIENT", "recv {%s}\n", buf);
@@ -249,5 +249,5 @@
 	CF_Socket_Close (sock);
 
-	return (CF_THREAD_RETURN)0;
+	return 0;
 	/*------------------------------------------------------------*/
 }
Index: /trunk/test/thread.c
===================================================================
--- /trunk/test/thread.c	(revision 56)
+++ /trunk/test/thread.c	(revision 57)
@@ -10,5 +10,5 @@
 CF_Mutex globalMutex;
 
-CF_THREAD_RETURN CF_THREAD_CALL worker (void * arg) {
+int worker (void * arg) {
 	if (CF_Mutex_Lock (&globalMutex) < 0) { // for critical section
 		// error
@@ -21,5 +21,5 @@
 	}
 
-	return (CF_THREAD_RETURN)0;
+	return 0;
 }
 
