This commit is contained in:
35
win32/Codemap.h
Normal file
35
win32/Codemap.h
Normal file
@@ -0,0 +1,35 @@
|
||||
#ifndef CGE_THREAD_CODEMAP_H
|
||||
#define CGE_THREAD_CODEMAP_H
|
||||
|
||||
#include "Internal.h"
|
||||
#include <errno.h>
|
||||
|
||||
static int errorToErrorCode(int value) {
|
||||
switch (value) {
|
||||
case 0:
|
||||
return CGE_THREAD_EOK;
|
||||
|
||||
case ERROR_INVALID_PARAMETER:
|
||||
case ERROR_INVALID_HANDLE:
|
||||
case ERROR_NOT_SUPPORTED:
|
||||
return CGE_THREAD_EINVAL;
|
||||
|
||||
case ERROR_NOT_ENOUGH_MEMORY:
|
||||
case ERROR_OUTOFMEMORY:
|
||||
case ERROR_MAX_THRDS_REACHED:
|
||||
case ERROR_NO_SYSTEM_RESOURCES:
|
||||
return CGE_THREAD_EOOM;
|
||||
|
||||
case ERROR_TIMEOUT:
|
||||
return CGE_THREAD_ETIMEDOUT;
|
||||
|
||||
case ERROR_BUSY:
|
||||
case ERROR_LOCK_VIOLATION:
|
||||
return CGE_THREAD_EBUSY;
|
||||
|
||||
default:
|
||||
return CGE_THREAD_EUNKNOWN;
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* CGE_THREAD_CODEMAP_H */
|
||||
Reference in New Issue
Block a user