Check if getenv() exists

Do not call getenv() on platform which do not support it
3 files changed