You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// For CF functions with 'Get' semantics, the compiler currently assumes that the result is autoreleased and must be retained. It does so on all platforms by emitting a call to objc_retainAutoreleasedReturnValue. On Darwin, this is implemented by the ObjC runtime. On Linux, there is no runtime, and therefore we have to stub it out here ourselves. The compiler will eventually call swift_release to balance the retain below. This is a workaround until the compiler no longer emits this callout on Linux.
if (identifier!=kCFGregorianCalendar&&identifier!=kCFBuddhistCalendar&&identifier!=kCFJapaneseCalendar&&identifier!=kCFIslamicCalendar&&identifier!=kCFIslamicCivilCalendar&&identifier!=kCFHebrewCalendar) {
if (identifier!=kCFGregorianCalendar&&identifier!=kCFBuddhistCalendar&&identifier!=kCFJapaneseCalendar&&identifier!=kCFIslamicCalendar&&identifier!=kCFIslamicCivilCalendar&&identifier!=kCFHebrewCalendar&&identifier!=kCFChineseCalendar) {
241
240
if (CFEqual(kCFGregorianCalendar, identifier)) identifier=kCFGregorianCalendar;
// return NULL until Chinese calendar is available
264
-
if (identifier!=kCFGregorianCalendar&&identifier!=kCFBuddhistCalendar&&identifier!=kCFJapaneseCalendar&&identifier!=kCFIslamicCalendar&&identifier!=kCFIslamicCivilCalendar&&identifier!=kCFHebrewCalendar) {
if (identifier!=kCFGregorianCalendar&&identifier!=kCFBuddhistCalendar&&identifier!=kCFJapaneseCalendar&&identifier!=kCFIslamicCalendar&&identifier!=kCFIslamicCivilCalendar&&identifier!=kCFHebrewCalendar&&identifier!=kCFChineseCalendar) {
266
264
if (CFEqual(kCFGregorianCalendar, identifier)) identifier=kCFGregorianCalendar;
Copy file name to clipboardExpand all lines: Docs/Design.md
+2Lines changed: 2 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -13,6 +13,8 @@ In a very limited number of cases, key Foundation API as it exists on Apple plat
13
13
14
14
A significant portion of the implementation of Foundation on Apple platforms is provided by another framework called CoreFoundation (a.k.a. CF). CF is written primarily in C and is very portable. Therefore we have chosen to use it for the internal implementation of Swift Foundation where possible. As CF is present on all platforms, we can use it to provide a common implementation everywhere.
15
15
16
+
Another aspect of portability is keeping dependencies to an absolute minimum. With fewer dependencies to port, it is more likely that Foundation will be able to easily compile and run on new platforms. Therefore, we will prefer solutions that are implemented in Foundation itself. Exceptions can be made for major functionality (for example, `ICU`, `libdispatch`, and `libxml2`).
17
+
16
18
## A Taxonomy of Types
17
19
18
20
A key to the internal design of the framework is the split between the CF implementation and Swift implementation of the Foundation classes. They can be organized into several categories.
When new source files or flags are added to the `build.py` script, the project will need to be reconfigured in order for the build system to pick them up. The top-level `swift/utils/build-script` can be used, but for quicker iteration you can use the following command to limit the reconfiguration to just the Foundation project:
0 commit comments