move some errno mappings to sigar.h

This commit is contained in:
Doug MacEachern 2007-04-05 15:49:17 +00:00
parent 5ec635a1b4
commit 9d528d6d78
2 changed files with 8 additions and 12 deletions

View File

@ -114,18 +114,6 @@ static void sigar_throw_notimpl(JNIEnv *env, char *msg)
JENV->ThrowNew(env, errorClass, msg); JENV->ThrowNew(env, errorClass, msg);
} }
#ifdef WIN32
# define SIGAR_ENOENT ERROR_FILE_NOT_FOUND
#else
# define SIGAR_ENOENT ENOENT
#endif
#ifdef WIN32
# define SIGAR_EACCES ERROR_ACCESS_DENIED
#else
# define SIGAR_EACCES EACCES
#endif
static void sigar_throw_error(JNIEnv *env, jni_sigar_t *jsigar, int err) static void sigar_throw_error(JNIEnv *env, jni_sigar_t *jsigar, int err)
{ {
jclass errorClass; jclass errorClass;

View File

@ -66,6 +66,14 @@ typedef long long sigar_int64_t;
#define SIGAR_ENOTIMPL (SIGAR_START_ERROR + 1) #define SIGAR_ENOTIMPL (SIGAR_START_ERROR + 1)
#define SIGAR_OS_START_ERROR (SIGAR_START_ERROR*2) #define SIGAR_OS_START_ERROR (SIGAR_START_ERROR*2)
#ifdef WIN32
# define SIGAR_ENOENT ERROR_FILE_NOT_FOUND
# define SIGAR_EACCES ERROR_ACCESS_DENIED
#else
# define SIGAR_ENOENT ENOENT
# define SIGAR_EACCES EACCES
#endif
#ifdef WIN32 #ifdef WIN32
# define SIGAR_DECLARE(type) \ # define SIGAR_DECLARE(type) \
__declspec(dllexport) type __stdcall __declspec(dllexport) type __stdcall