mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-10-22 02:37:26 +02:00
Explicitly include <unistd.h>.
This commit is contained in:
@@ -331,6 +331,12 @@ get_target_property(LDC_LOC ${LDC_EXE} LOCATION)
|
|||||||
#
|
#
|
||||||
# LDMD
|
# LDMD
|
||||||
#
|
#
|
||||||
|
include(CheckSymbolExists)
|
||||||
|
CHECK_SYMBOL_EXISTS(_SC_ARG_MAX "unistd.h" HAVE_SC_ARG_MAX)
|
||||||
|
if (HAVE_SC_ARG_MAX)
|
||||||
|
add_definitions(-DHAVE_SC_ARG_MAX)
|
||||||
|
endif()
|
||||||
|
|
||||||
set_source_files_properties(dmd2/root/response.c dmd2/root/man.c PROPERTIES LANGUAGE CXX)
|
set_source_files_properties(dmd2/root/response.c dmd2/root/man.c PROPERTIES LANGUAGE CXX)
|
||||||
add_executable(${LDMD_EXE} dmd2/root/response.c dmd2/root/man.c driver/ldmd.cpp)
|
add_executable(${LDMD_EXE} dmd2/root/response.c dmd2/root/man.c driver/ldmd.cpp)
|
||||||
set_target_properties(${LDMD_EXE} PROPERTIES
|
set_target_properties(${LDMD_EXE} PROPERTIES
|
||||||
|
|||||||
+10
-4
@@ -55,6 +55,10 @@
|
|||||||
#include "llvm/Support/SystemUtils.h"
|
#include "llvm/Support/SystemUtils.h"
|
||||||
#include "llvm/Support/raw_ostream.h"
|
#include "llvm/Support/raw_ostream.h"
|
||||||
|
|
||||||
|
#ifdef HAVE_SC_ARG_MAX
|
||||||
|
# include <unistd.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace ls = llvm::sys;
|
namespace ls = llvm::sys;
|
||||||
|
|
||||||
// We reuse DMD's response file parsing routine for maximum compatibilty - it
|
// We reuse DMD's response file parsing routine for maximum compatibilty - it
|
||||||
@@ -784,13 +788,15 @@ void buildCommandLine(std::vector<const char*>& r, const Params& p)
|
|||||||
*/
|
*/
|
||||||
size_t maxCommandLineLen()
|
size_t maxCommandLineLen()
|
||||||
{
|
{
|
||||||
#ifdef WINDOWS
|
#if defined(HAVE_SC_ARG_MAX)
|
||||||
// http://blogs.msdn.com/b/oldnewthing/archive/2003/12/10/56028.aspx
|
|
||||||
return 32767;
|
|
||||||
#else
|
|
||||||
// http://www.in-ulm.de/~mascheck/various/argmax – the factor 2 is just
|
// http://www.in-ulm.de/~mascheck/various/argmax – the factor 2 is just
|
||||||
// a wild guess to account for the enviroment.
|
// a wild guess to account for the enviroment.
|
||||||
return sysconf(_SC_ARG_MAX) / 2;
|
return sysconf(_SC_ARG_MAX) / 2;
|
||||||
|
#elif defined(_WIN32)
|
||||||
|
// http://blogs.msdn.com/b/oldnewthing/archive/2003/12/10/56028.aspx
|
||||||
|
return 32767;
|
||||||
|
#else
|
||||||
|
# error "Do not know how to determine maximum command line length."
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user