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