mirror of
				https://github.com/janet-lang/janet
				synced 2025-10-31 15:43:01 +00:00 
			
		
		
		
	Add more values for (os/which)
Some bsd flavors.
This commit is contained in:
		| @@ -296,11 +296,12 @@ | |||||||
|   (def lflags [;(opt opts :lflags default-lflags) |   (def lflags [;(opt opts :lflags default-lflags) | ||||||
|                ;(if (opts :static) [] dynamic-lflags) |                ;(if (opts :static) [] dynamic-lflags) | ||||||
|                ;(if standalone (case (os/which) |                ;(if standalone (case (os/which) | ||||||
|                                 :posix ["-ldl" "-lm"] |  | ||||||
|                                 :macos ["-ldl" "-lm"] |                                 :macos ["-ldl" "-lm"] | ||||||
|                                 :windows [] |                                 :windows [] | ||||||
|                                 :linux ["-lm" "-ldl" "-lrt"] |                                 :linux ["-lm" "-ldl" "-lrt"] | ||||||
|                                 []) [])]) |                                 :openbsd ["-lm"] | ||||||
|  |                                 #default | ||||||
|  |                                 ["-ldl" "-lm"]) [])]) | ||||||
|   (rule target objects |   (rule target objects | ||||||
|         (print "linking " target "...") |         (print "linking " target "...") | ||||||
|         (if is-win |         (if is-win | ||||||
|   | |||||||
| @@ -75,6 +75,12 @@ static Janet os_which(int32_t argc, Janet *argv) { | |||||||
|     return janet_ckeywordv("web"); |     return janet_ckeywordv("web"); | ||||||
| #elif defined(__linux__) | #elif defined(__linux__) | ||||||
|     return janet_ckeywordv("linux"); |     return janet_ckeywordv("linux"); | ||||||
|  | #elif define(__FreeBSD__) | ||||||
|  |     return janet_ckeywordv("freebsd"); | ||||||
|  | #elif define(__NetBSD__) | ||||||
|  |     return janet_ckeywordv("netbsd"); | ||||||
|  | #elif define(__OpenBSD__) | ||||||
|  |     return janet_ckeywordv("openbsd"); | ||||||
| #else | #else | ||||||
|     return janet_ckeywordv("posix"); |     return janet_ckeywordv("posix"); | ||||||
| #endif | #endif | ||||||
| @@ -763,10 +769,13 @@ static const JanetReg os_cfuns[] = { | |||||||
|         "os/which", os_which, |         "os/which", os_which, | ||||||
|         JDOC("(os/which)\n\n" |         JDOC("(os/which)\n\n" | ||||||
|              "Check the current operating system. Returns one of:\n\n" |              "Check the current operating system. Returns one of:\n\n" | ||||||
|              "\t:windows - Microsoft Windows\n" |              "\t:windows\n" | ||||||
|              "\t:macos - Apple macos\n" |              "\t:macos\n" | ||||||
|              "\t:web - Web assembly (emscripten)\n" |              "\t:web - Web assembly (emscripten)\n" | ||||||
|              "\t:linux - Linux\n" |              "\t:linux\n" | ||||||
|  |              "\t:freebsd\n" | ||||||
|  |              "\t:openbsd\n" | ||||||
|  |              "\t:netbsd\n" | ||||||
|              "\t:posix - A POSIX compatible system (default)") |              "\t:posix - A POSIX compatible system (default)") | ||||||
|     }, |     }, | ||||||
|     { |     { | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Calvin Rose
					Calvin Rose