YARP
Yet Another Robot Platform
PlatformDirent.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  *
5  * This software may be modified and distributed under the terms of the
6  * BSD-3-Clause license. See the accompanying LICENSE file for details.
7  */
8 
9 #ifndef YARP_OS_IMPL_PLATFORMDIRENT_H
10 #define YARP_OS_IMPL_PLATFORMDIRENT_H
11 
12 #include <yarp/conf/system.h>
13 #if defined(YARP_HAS_ACE)
14 # include <ace/OS_NS_dirent.h>
15 // In one the ACE headers there is a definition of "main" for WIN32
16 # ifdef main
17 # undef main
18 # endif
19 #else
20 # include <dirent.h>
21 # include <sys/types.h>
22 #endif
23 
24 namespace yarp {
25 namespace os {
26 namespace impl {
27 
28 #if defined(YARP_HAS_ACE)
29 typedef ACE_DIRENT dirent;
30 typedef ACE_DIR DIR;
31 using ACE_OS::closedir;
32 using ACE_OS::opendir;
33 using ACE_OS::scandir;
34 inline int alphasort(const ACE_DIRENT** f1, const ACE_DIRENT** f2)
35 {
36  return ACE_OS::alphasort(f1, f2);
37 }
38 #else
39 using ::alphasort;
40 using ::closedir;
41 using ::DIR;
42 using ::dirent;
43 using ::opendir;
44 using ::scandir;
45 #endif
46 
47 } // namespace impl
48 } // namespace os
49 } // namespace yarp
50 
51 #endif // YARP_OS_IMPL_PLATFORMDIRENT_H
system.h
yarp
The main, catch-all namespace for YARP.
Definition: environment.h:18