Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
asdf
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Didier Verna
asdf
Commits
84fb7617
Commit
84fb7617
authored
9 years ago
by
Francois-Rene Rideau
Browse files
Options
Downloads
Patches
Plain Diff
Test OS predicates at runtime only
Thus, you can test the *features* as locally bound from some target system.
parent
62a1800e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
uiop/os.lisp
+10
-13
10 additions, 13 deletions
uiop/os.lisp
with
10 additions
and
13 deletions
uiop/os.lisp
+
10
−
13
View file @
84fb7617
...
...
@@ -33,32 +33,29 @@ keywords explicitly."
((
eq
:and
(
car
x
))
(
every
#'
featurep
(
cdr
x
)))
(
t
(
error
"Malformed feature specification ~S"
x
))))
(
defun
os-unix-p
()
"Is the underlying operating system some Unix variant?"
(
or
#+
abcl
(
featurep
:unix
)
#+
(
and
(
not
abcl
)
(
or
unix
cygwin
darwin
))
t
))
;; Starting with UIOP 3.1.5, these are runtime tests.
;; You may bind *features* with a copy of what your target system offers to test its properties.
(
defun
os-macosx-p
()
"Is the underlying operating system MacOS X?"
;; OS-MACOSX is not mutually exclusive with OS-UNIX,
;; in fact the former implies the latter.
(
or
#+
allegro
(
featurep
:macosx
)
#+
clisp
(
featurep
:macos
)
(
featurep
:darwin
)))
(
featurep
'
(
:or
:darwin
(
:and
:allegro
:macosx
)
(
:and
:clisp
:macos
))))
(
defun
os-unix-p
()
"Is the underlying operating system some Unix variant?"
(
or
(
featurep
'
(
:or
:unix
:cygwin
))
(
os-macosx-p
)))
(
defun
os-windows-p
()
"Is the underlying operating system Microsoft Windows?"
(
or
#+
abcl
(
featurep
:windows
)
#+
(
and
(
not
(
or
abcl
unix
cygwin
darwin
))
(
or
win32
windows
mswindows
mingw32
mingw64
))
t
))
(
and
(
not
(
os-unix-p
))
(
featurep
'
(
:or
:win32
:windows
:mswindows
:mingw32
:mingw64
))))
(
defun
os-genera-p
()
"Is the underlying operating system Genera (running on a Symbolics Lisp Machine)?"
(
or
#+
genera
t
))
(
featurep
:
genera
))
(
defun
os-oldmac-p
()
"Is the underlying operating system an (emulated?) MacOS 9 or earlier?"
(
or
#+
mcl
t
))
(
featurep
:
mcl
))
(
defun
detect-os
()
"Detects the current operating system. Only needs be run at compile-time,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment