cpp: Use cstdlib getenv for portability

* lang/cpp/src/editinteractor.cpp (EditInteractor::Private::Private):
Use std::getenv.

--
This should fix compiling on MacOS X

GnuPG-Bug-Id: T5013
This commit is contained in:
Andre Heinecke 2020-08-06 09:50:16 +02:00
parent 8950150913
commit 0676d41ef5
No known key found for this signature in database
GPG Key ID: 2978E9D40CBABA5C

View File

@ -41,6 +41,7 @@
#include <cerrno> #include <cerrno>
#include <cstring> #include <cstring>
#include <cstdlib>
#ifndef GPG_ERR_ALREADY_SIGNED #ifndef GPG_ERR_ALREADY_SIGNED
# define GPG_ERR_ALREADY_SIGNED GPG_ERR_USER_1 # define GPG_ERR_ALREADY_SIGNED GPG_ERR_USER_1
@ -178,7 +179,7 @@ EditInteractor::Private::Private(EditInteractor *qq)
error(), error(),
debug(nullptr) debug(nullptr)
{ {
const char *debug_env = getenv("GPGMEPP_INTERACTOR_DEBUG"); const char *debug_env = std::getenv("GPGMEPP_INTERACTOR_DEBUG");
if (!debug_env) { if (!debug_env) {
return; return;
} }