YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
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
21namespace yarp::os::impl {
22
23#if defined(YARP_HAS_ACE)
24typedef ACE_DIRENT dirent;
25typedef ACE_DIR DIR;
26using ACE_OS::closedir;
27using ACE_OS::opendir;
28using ACE_OS::scandir;
29inline int alphasort(const ACE_DIRENT** f1, const ACE_DIRENT** f2)
30{
31 return ACE_OS::alphasort(f1, f2);
32}
33#else
34using ::alphasort;
35using ::closedir;
36using ::DIR;
37using ::dirent;
38using ::opendir;
39using ::scandir;
40#endif
41
42} // namespace yarp::os::impl
43
44#endif // YARP_OS_IMPL_PLATFORMDIRENT_H
The components from which ports and connections are built.