Fix compile when NO_OS_DEPENDENCE is defined
parent
3a18d73cc1
commit
6d5316812f
|
|
@ -44,7 +44,7 @@
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
// Friendly name
|
// Friendly name
|
||||||
#define LIBRARY_NAME "Crypto++ Library"
|
#define LIBRARY_DESC "Crypto++ Library"
|
||||||
typedef std::set<std::string> SymbolMap;
|
typedef std::set<std::string> SymbolMap;
|
||||||
|
|
||||||
const int ErrorSuccess = 0;
|
const int ErrorSuccess = 0;
|
||||||
|
|
@ -190,7 +190,7 @@ int main(int argc, char* argv[])
|
||||||
name.erase(pos);
|
name.erase(pos);
|
||||||
|
|
||||||
outfile << "LIBRARY " << name << std::endl;
|
outfile << "LIBRARY " << name << std::endl;
|
||||||
outfile << "DESCRIPTION \"" << LIBRARY_NAME << "\"" << std::endl;
|
outfile << "DESCRIPTION \"" << LIBRARY_DESC << "\"" << std::endl;
|
||||||
outfile << "EXPORTS" << std::endl;
|
outfile << "EXPORTS" << std::endl;
|
||||||
outfile << std::endl;
|
outfile << std::endl;
|
||||||
|
|
||||||
|
|
|
||||||
23
test.cpp
23
test.cpp
|
|
@ -448,22 +448,21 @@ int scoped_main(int argc, char *argv[])
|
||||||
|
|
||||||
void SetArgvPathHint(const char* argv0, std::string& pathHint)
|
void SetArgvPathHint(const char* argv0, std::string& pathHint)
|
||||||
{
|
{
|
||||||
|
# if (PATH_MAX > 0) // Posix
|
||||||
|
size_t path_max = (size_t)PATH_MAX;
|
||||||
|
#elif (MAX_PATH > 0) // Microsoft
|
||||||
|
size_t path_max = (size_t)MAX_PATH;
|
||||||
|
#else
|
||||||
|
size_t path_max = 260;
|
||||||
|
#endif
|
||||||
|
|
||||||
// OS X and Solaris provide a larger path using pathconf than MAX_PATH.
|
// OS X and Solaris provide a larger path using pathconf than MAX_PATH.
|
||||||
// Also see https://stackoverflow.com/a/33249023/608639 for FreeBSD.
|
// Also see https://stackoverflow.com/a/33249023/608639 for FreeBSD.
|
||||||
#if defined(UNIX_PATH_FAMILY)
|
#if defined(_PC_PATH_MAX)
|
||||||
size_t path_max = 0;
|
|
||||||
long ret = pathconf(argv0, _PC_PATH_MAX);
|
long ret = pathconf(argv0, _PC_PATH_MAX);
|
||||||
|
const size_t old_path_max = path_max;
|
||||||
if (SafeConvert(ret, path_max) == false)
|
if (SafeConvert(ret, path_max) == false)
|
||||||
{
|
path_max = old_path_max;
|
||||||
# if defined(MAX_PATH)
|
|
||||||
path_max = MAX_PATH;
|
|
||||||
# else
|
|
||||||
path_max = 4096;
|
|
||||||
# endif
|
|
||||||
}
|
|
||||||
#else
|
|
||||||
// Windows and others?
|
|
||||||
size_t path_max = MAX_PATH;
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const size_t argLen = std::strlen(argv0);
|
const size_t argLen = std::strlen(argv0);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue