* src/vm/os.hpp (call_scandir): Rename template arguments because of a
[cacao.git] / src / vm / os.hpp
index c882a6d0fd4795a3d90ab441b1f593a13b25e921..752b76364ad621a5eceb5a70f1e2ee6c0a52aa9a 100644 (file)
@@ -1,6 +1,6 @@
 /* src/vm/os.hpp - system (OS) functions
 
-   Copyright (C) 2007, 2008, 2009
+   Copyright (C) 2007, 2008, 2009, 2010
    CACAOVM - Verein zur Foerderung der freien virtuellen Maschine CACAO
    Copyright (C) 2008 Theobroma Systems Ltd.
 
 # include <unistd.h>
 #endif
 
+#if defined(__DARWIN__)
+# if defined(HAVE_MACH_MACH_H)
+#  include <mach/mach.h>
+# endif
+#endif
+
 #if defined(HAVE_SYS_LOADAVG_H)
 # include <sys/loadavg.h>
 #endif
 # include <sys/types.h>
 #endif
 
+#if defined(HAVE_SYS_UTSNAME_H)
+# include <sys/utsname.h>
+#endif
+
 
 #ifdef __cplusplus
 
@@ -177,8 +187,8 @@ public:
        static int   processors_online();
 
        // Template helper
-       template<class F1, class F2>
-       static int call_scandir(int (*scandir)(const char *, struct dirent ***, F1, F2), const char *dir, struct dirent ***namelist, int(*filter)(const struct dirent *), int(*compar)(const void *, const void *));
+       template<class _F1, class _F2>
+       static int call_scandir(int (*scandir)(const char *, struct dirent ***, _F1, _F2), const char *dir, struct dirent ***namelist, int(*filter)(const struct dirent *), int(*compar)(const void *, const void *));
 };
 
 
@@ -543,10 +553,10 @@ inline static void *system_realloc(void *ptr, size_t size)
 #endif
 }
 
-template<class F1, class F2>
-inline int os::call_scandir(int (*scandir)(const char *, struct dirent ***, F1, F2), const char *dir, struct dirent ***namelist, int(*filter)(const struct dirent *), int(*compar)(const void *, const void *))
+template<class _F1, class _F2>
+inline int os::call_scandir(int (*scandir)(const char *, struct dirent ***, _F1, _F2), const char *dir, struct dirent ***namelist, int(*filter)(const struct dirent *), int(*compar)(const void *, const void *))
 {
-       return scandir(dir, namelist, (F1) filter, (F2) compar);
+       return scandir(dir, namelist, (_F1) filter, (_F2) compar);
 }
 
 inline int os::scandir(const char *dir, struct dirent ***namelist, int(*filter)(const struct dirent *), int(*compar)(const void *, const void *))
@@ -682,25 +692,10 @@ inline static ssize_t system_write(int fd, const void *buf, size_t count)
 
 void*  os_mmap_anonymous(void *addr, size_t len, int prot, int flags);
 
-void   os_abort(void);
-int    os_access(const char* pathname, int mode);
 int    os_atoi(const char* nptr);
-void*  os_calloc(size_t nmemb, size_t size);
-char*  os_dirname(char* path);
-char*  os_dlerror(void);
-void*  os_dlsym(void* handle, const char* symbol);
-int    os_fclose(FILE* fp);
-FILE*  os_fopen(const char* path, const char* mode);
-size_t os_fread(void* ptr, size_t size, size_t nmemb, FILE* stream);
-void   os_free(void* ptr);
 int    os_getpagesize(void);
 void*  os_memcpy(void* dest, const void* src, size_t n);
 void*  os_memset(void* s, int c, size_t n);
-int    os_mprotect(void* addr, size_t len, int prot);
-int    os_scandir(const char* dir, struct dirent*** namelist, int(*filter)(const struct dirent*), int(*compar)(const void*, const void*));
-int    os_stat(const char* path, struct stat* buf);
-char*  os_strcat(char* dest, const char* src);
-char*  os_strcpy(char* dest, const char* src);
 char*  os_strdup(const char* s);
 int    os_strlen(const char* s);