Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stdlib/public/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
endif()
endif()

if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
if(CMAKE_SYSTEM_NAME STREQUAL "Linux" OR CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
add_subdirectory(Glibc)
endif()
5 changes: 5 additions & 0 deletions stdlib/public/Glibc/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@ if (NOT EXISTS "${GLIBC_ARCH_INCLUDE_PATH}/sys")
endif()

# Generate module.map
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
configure_file(module.map.in "${CMAKE_CURRENT_BINARY_DIR}/module.map" @ONLY)
endif()
if(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
configure_file(module.freebsd.map.in "${CMAKE_CURRENT_BINARY_DIR}/module.map" @ONLY)
endif()

add_custom_command_target(unused_var
COMMAND
Expand Down
8 changes: 8 additions & 0 deletions stdlib/public/Glibc/Glibc.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,18 @@

public var errno: Int32 {
get {
#if os(FreeBSD)
return __error().memory
#else
return __errno_location().memory
#endif
}
set(val) {
#if os(FreeBSD)
return __error().memory = val
#else
return __errno_location().memory = val
#endif
}
}

Expand Down
Loading