Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cstdlib.hpp « std - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8268726dcf861b409796f16b2f3c345c4659195d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#pragma once

#include "target_os.hpp"

#ifdef new
#undef new
#endif

#include <cstdlib>

// setenv is absent in MSVC.
#ifdef OMIM_OS_WINDOWS_NATIVE
#include <cstdio> // Need it for snprintf.
inline int setenv(char const * name, char const * value, int /*overwrite*/)
{
  char buffer[255];
  int const err = ::snprintf(buffer, sizeof(buffer), "%s=%s", name, value);
  if (err < 0 || err >= sizeof(buffer))
    return -1;
  return ::_putenv(buffer);
}
#endif

#ifdef DEBUG_NEW
#define new DEBUG_NEW
#endif