mirror of
https://github.com/dlang/phobos.git
synced 2025-04-28 14:10:30 +03:00
* Changed a few version(linux) blocks to version(Posix).
* Changed some declarations from explicit to auto. * Changed "mkdir --parents" in Makefile to "mkdir -p" since OSX doesn't support the long version. * REMAINING ISSUE: The "ln -sf" for installing the libraries at the end will fail if the DMD installation point is not owned by the user performing the build. A "sudo ln..." fixes this, but it still may not be ideal to have a system-level link to a user-level file. This should probably simply be copied instead. Also, this copy should perhaps be done manually or in an "install" step, since a user may want to build Phobos and test it out without affecting other users.
This commit is contained in:
parent
c71920b5f0
commit
67cf1f1be7
4 changed files with 12 additions and 12 deletions
8
Makefile
8
Makefile
|
@ -3,7 +3,7 @@
|
|||
DOCDIR = ../web/phobos
|
||||
DOC_OUTPUT_DIR = ../web/phobos
|
||||
DRUNTIMEDIR = ../druntime/lib
|
||||
PRODUCTIONLIBDIR = $(dir $(shell which dmd))/../lib
|
||||
PRODUCTIONLIBDIR = $(dir $(shell which dmd))../lib
|
||||
OBJDIR = obj
|
||||
DOCSRC = ../docsrc
|
||||
STDDOC = $(DOCSRC)/std.ddoc
|
||||
|
@ -45,7 +45,7 @@ STD_MODULES = $(addprefix std/, algorithm array atomics base64 bigint \
|
|||
stdio stdiobase stream string syserror system traits typecons \
|
||||
typetuple uni uri utf variant xml zip zlib)
|
||||
EXTRA_MODULES = $(addprefix std/c/, stdarg stdio) $(addprefix etc/c/, \
|
||||
zlib) etc/algorithm etc/random
|
||||
zlib)
|
||||
EXTRA_MODULES_posix = $(addprefix std/c/linux/, linux socket)
|
||||
EXTRA_MODULES_win32 = $(addprefix std/c/windows/, com stat windows winsock) \
|
||||
$(addprefix std/windows/, charset iunknown syserror)
|
||||
|
@ -92,7 +92,7 @@ SRC2LIB_$1 = $$(addsuffix .d,crc32 $(STD_MODULES) $(EXTRA_MODULES) \
|
|||
$(EXTRA_MODULES_$1))
|
||||
|
||||
$$(OBJDIR)/$1/$2/%$$(OBJSUFFIX_$1) : %.c $$(OBJDIR)/$1/$2/.directory
|
||||
@mkdir --parents $$(dir $$@)
|
||||
@mkdir -p $$(dir $$@)
|
||||
$(CC_$1) -c $(CFLAGS_$1_$2) -o$$@ $$<
|
||||
|
||||
$$(OBJDIR)/$1/$2/unittest/std/% : std/%.d \
|
||||
|
@ -129,7 +129,7 @@ $(LIBDRUNTIME_$1)
|
|||
@$(DMD_$1) $(DFLAGS_$2) -lib -of$$@ $$^
|
||||
|
||||
$$(OBJDIR)/$1/$2/.directory :
|
||||
mkdir --parents $$@
|
||||
mkdir -p $$@
|
||||
|
||||
$1/$2/unittest : $1/$2 $$(addprefix $$(OBJDIR)/$1/$2/unittest/,$(STD_MODULES))
|
||||
|
||||
|
|
|
@ -314,7 +314,7 @@ class MmFile
|
|||
|
||||
errnoEnforce(false);
|
||||
}
|
||||
else version (linux)
|
||||
else version (Posix)
|
||||
{
|
||||
auto namez = toStringz(filename);
|
||||
void* p;
|
||||
|
@ -445,7 +445,7 @@ class MmFile
|
|||
{
|
||||
FlushViewOfFile(data.ptr, data.length);
|
||||
}
|
||||
else version (linux)
|
||||
else version (Posix)
|
||||
{
|
||||
int i;
|
||||
i = msync(cast(void*)data, data.length, MS_SYNC); // sys/mman.h
|
||||
|
@ -616,7 +616,7 @@ private:
|
|||
HANDLE hFileMap = null;
|
||||
uint dwDesiredAccess;
|
||||
}
|
||||
else version (linux)
|
||||
else version (Posix)
|
||||
{
|
||||
int fd;
|
||||
int prot;
|
||||
|
|
|
@ -864,7 +864,7 @@ $(D Range that locks the file and allows fast writing to it. */
|
|||
handle);
|
||||
}
|
||||
}
|
||||
else version (linux)
|
||||
else version (Posix)
|
||||
{
|
||||
FPUTWC(c, handle);
|
||||
}
|
||||
|
|
|
@ -1813,7 +1813,7 @@ class File: Stream {
|
|||
version(Windows) {
|
||||
seekable = GetFileType(hFile) == 1; // FILE_TYPE_DISK
|
||||
} else {
|
||||
ulong result = lseek(hFile, 0, 0);
|
||||
auto result = lseek(hFile, 0, 0);
|
||||
seekable = (result != ~0);
|
||||
}
|
||||
}
|
||||
|
@ -1982,12 +1982,12 @@ class File: Stream {
|
|||
throw new SeekException("unable to move file pointer");
|
||||
ulong result = (cast(ulong)hi << 32) + low;
|
||||
} else version (Posix) {
|
||||
ulong result = lseek(hFile, cast(int)offset, rel);
|
||||
if (result == 0xFFFFFFFF)
|
||||
auto result = lseek(hFile, cast(int)offset, rel);
|
||||
if (result == cast(typeof(result))-1)
|
||||
throw new SeekException("unable to move file pointer");
|
||||
}
|
||||
readEOF = false;
|
||||
return result;
|
||||
return cast(ulong)result;
|
||||
}
|
||||
|
||||
/***
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue