YARP
Yet Another Robot Platform
Loading...
Searching...
No Matches
PlatformStdlib.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_RUN_IMPL_PLATFORMSTDLIB_H
7
#define YARP_RUN_IMPL_PLATFORMSTDLIB_H
8
9
#include <
yarp/conf/system.h
>
10
#ifdef YARP_HAS_ACE
11
# include <ace/OS_NS_stdlib.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 <stdlib.h>
18
#endif
19
20
namespace
yarp::run::impl
{
21
22
23
#if defined(YARP_HAS_ACE)
24
using
std::getenv;
25
# if defined(_MSC_VER)
26
// ACE bindings for setenv and unsetenv do not work
27
// on Visual Studio (last tested ACE 6.4.2, VS 2015).
28
inline
int
setenv(
const
char
* name,
const
char
* value,
int
overwrite)
29
{
30
YARP_UNUSED
(overwrite);
31
return
_putenv_s(name, value);
32
}
33
inline
int
unsetenv(
const
char
* name)
34
{
35
return
_putenv_s(name,
""
);
36
}
37
# else
38
using
ACE_OS::setenv;
39
using
ACE_OS::unsetenv;
40
# endif
41
using
ACE_OS::putenv;
42
#else
43
using
std::getenv;
44
using ::setenv;
45
using ::unsetenv;
46
using ::putenv;
47
#endif
48
49
}
// namespace yarp::run::impl
50
51
#endif
// YARP_RUN_IMPL_PLATFORMSTDLIB_H
yarp::run::impl
Definition
PlatformStdlib.h:20
system.h
YARP_UNUSED
#define YARP_UNUSED(var)
Definition
api.h:162
YARP
3.11.2
src
libYARP_run
src
yarp
run
impl
PlatformStdlib.h
Generated on Sat Mar 1 2025 02:35:34 for YARP by
1.9.8