mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-21 14:49:18 +02:00
Merge pull request #450 from okuoku/win32-cmake
Misc. fixes for Windows build
This commit is contained in:
commit
b9172a366c
4 changed files with 29 additions and 13 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -17,6 +17,7 @@
|
|||
|
||||
# Shared objects (inc. Windows DLLs)
|
||||
*.dll
|
||||
*.dll.*
|
||||
*.so
|
||||
*.so.*
|
||||
*.dylib
|
||||
|
@ -48,6 +49,7 @@ lib/chibi/process.c
|
|||
lib/chibi/stty.c
|
||||
lib/chibi/system.c
|
||||
lib/chibi/time.c
|
||||
lib/chibi/win32/process-win32.c
|
||||
lib/srfi/144/math.c
|
||||
*.tgz
|
||||
*.html
|
||||
|
|
|
@ -250,8 +250,6 @@ foreach(e ${chibi-scheme-tests})
|
|||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
endforeach()
|
||||
|
||||
message(STATUS "Detecting library tests")
|
||||
|
||||
file(GLOB_RECURSE srfi_tests RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/lib
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/lib/srfi/*/test.sld)
|
||||
|
||||
|
@ -270,6 +268,7 @@ set(testexcludes
|
|||
chibi/doc-test # Depends (chibi time)
|
||||
chibi/system-test
|
||||
chibi/tar-test # Depends (chibi system)
|
||||
chibi/process-test # Not applicable
|
||||
)
|
||||
|
||||
set(testlibs)
|
||||
|
@ -287,6 +286,5 @@ foreach(e ${testlibs})
|
|||
COMMAND chibi-scheme -e "(import (${form}))"
|
||||
-e "(run-tests)"
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
|
||||
message(STATUS "Test ${testname}")
|
||||
endforeach()
|
||||
|
||||
|
|
|
@ -14,6 +14,9 @@ environment:
|
|||
- ARCH: x86
|
||||
TOOLCHAIN: MinGW
|
||||
BUILDSYSTEM: CMAKE
|
||||
- ARCH: x64
|
||||
TOOLCHAIN: MinGW
|
||||
BUILDSYSTEM: CMAKE
|
||||
- ARCH: x86
|
||||
TOOLCHAIN: MSVC
|
||||
BUILDSYSTEM: CMAKE
|
||||
|
|
|
@ -123,8 +123,13 @@
|
|||
(define (file-group x) (stat-gid (if (stat? x) x (file-status x))))
|
||||
(define (file-represented-device x) (stat-rdev (if (stat? x) x (file-status x))))
|
||||
(define (file-size x) (stat-size (if (stat? x) x (file-status x))))
|
||||
(define (file-block-size x) (stat-blksize (if (stat? x) x (file-status x))))
|
||||
(define (file-num-blocks x) (stat-blocks (if (stat? x) x (file-status x))))
|
||||
(cond-expand
|
||||
(windows
|
||||
(define (file-block-size x) 1)
|
||||
(define (file-num-blocks x) (file-size x)))
|
||||
(else
|
||||
(define (file-block-size x) (stat-blksize (if (stat? x) x (file-status x))))
|
||||
(define (file-num-blocks x) (stat-blocks (if (stat? x) x (file-status x))))))
|
||||
(define (file-access-time x) (stat-atime (if (stat? x) x (file-status x))))
|
||||
(define (file-modification-time x) (stat-mtime (if (stat? x) x (file-status x))))
|
||||
(define (file-modification-time/safe x)
|
||||
|
@ -149,9 +154,13 @@
|
|||
(define (file-character? x) (file-test-mode S_ISCHR x))
|
||||
(define (file-block? x) (file-test-mode S_ISBLK x))
|
||||
(define (file-fifo? x) (file-test-mode S_ISFIFO x))
|
||||
(define (file-link? x)
|
||||
(let ((st (if (stat? x) x (file-link-status x))))
|
||||
(and st (S_ISLNK (stat-mode st)))))
|
||||
(cond-expand
|
||||
(windows
|
||||
(define (file-link? x) #f))
|
||||
(else
|
||||
(define (file-link? x)
|
||||
(let ((st (if (stat? x) x (file-link-status x))))
|
||||
(and st (S_ISLNK (stat-mode st)))))))
|
||||
(define (file-socket? x) (file-test-mode S_ISSOCK x))
|
||||
(define (file-exists? x) (and (if (stat? x) #t (file-status x)) #t))
|
||||
|
||||
|
@ -180,8 +189,12 @@
|
|||
;;> Returns the path the symbolic link \var{file} points to, or
|
||||
;;> \scheme{#f} on error.
|
||||
|
||||
(define (read-link file)
|
||||
(let* ((buf (make-string 512))
|
||||
(res (readlink file buf 512)))
|
||||
(and (positive? res)
|
||||
(substring buf 0 res))))
|
||||
(cond-expand
|
||||
(windows
|
||||
(define (read-link file) #f))
|
||||
(else
|
||||
(define (read-link file)
|
||||
(let* ((buf (make-string 512))
|
||||
(res (readlink file buf 512)))
|
||||
(and (positive? res)
|
||||
(substring buf 0 res))))))
|
||||
|
|
Loading…
Add table
Reference in a new issue