YARP  2.3.68+272-20170522.1+git50f0ae7
Yet Another Robot Platform
PlatformStdlib.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2011 Department of Robotics Brain and Cognitive Sciences - Istituto Italiano di Tecnologia, Anne van Rossum
3  * Authors: Paul Fitzpatrick, Anne van Rossum
4  * CopyPolicy: Released under the terms of the LGPLv2.1 or later, see LGPL.TXT
5  */
6 
7 #ifndef YARP_OS_IMPL_PLATFORMSTDLIB_H
8 #define YARP_OS_IMPL_PLATFORMSTDLIB_H
9 
10 #include <yarp/conf/system.h>
11 #ifdef YARP_HAS_ACE
12 # include <ace/OS_NS_stdlib.h>
13 # include <ace/OS_NS_string.h>
14 # include <ace/OS_NS_sys_stat.h>
15 # include <ace/OS_NS_dirent.h>
16 # include <ace/OS_NS_unistd.h>
17 #else
18 # include <cstring>
19 # include <stdlib.h>
20 # include <string.h>
21 # include <unistd.h>
22 # include <dirent.h>
23 # include <sys/types.h>
24 # include <sys/stat.h>
25 # ifndef ACE_OS
26 # define ACE_OS
27 # endif
28 # ifndef ACE_stat
29 # define ACE_stat struct stat
30 # endif
31 # ifndef ACE_DIRENT
32 # define ACE_DIRENT dirent
33 # endif
34 # ifndef ACE_DIR
35 # define ACE_DIR DIR
36 # endif
37 #endif
38 
39 // ACE wrappers are glitching on Debian 4; use workaround
40 #if defined(__linux__) || !defined(YARP_HAS_ACE)
41 #define YARP_DIRENT dirent
42 #define YARP_readdir ::readdir
43 #define YARP_scandir ::scandir
44 #define YARP_closedir ::closedir
45 #define YARP_alphasort ::alphasort
46 #define YARP_unlink ::unlink
47 #define YARP_opendir ::opendir
48 #define YARP_stat ::stat
49 #else
50 #define YARP_DIRENT ACE_DIRENT
51 #define YARP_readdir ACE_OS::readdir
52 #define YARP_closedir ACE_OS::closedir
53 #define YARP_scandir ACE_OS::scandir
54 #define YARP_alphasort (ACE_SCANDIR_COMPARATOR)ACE_OS::alphasort
55 #define YARP_unlink ACE_OS::unlink
56 #define YARP_opendir ACE_OS::opendir
57 #define YARP_stat ACE_OS::stat
58 #endif
59 
60 #endif // YARP_OS_IMPL_PLATFORMSTDLIB_H