|
10 | 10 | //
|
11 | 11 | //===----------------------------------------------------------------------===//
|
12 | 12 |
|
13 |
| -#if compiler(>=5.8) && hasAttribute(freestanding) |
14 | 13 | /// Specifies the module and type name for an externally-defined macro, which
|
15 | 14 | /// must conform to the appropriate set of `Macro` protocols.
|
16 | 15 | ///
|
|
24 | 23 | public macro externalMacro<T>(module: String, type: String) -> T =
|
25 | 24 | Builtin.ExternalMacro
|
26 | 25 |
|
27 |
| -#endif |
| 26 | +// File and path-related information |
| 27 | + |
| 28 | +/// Produces a unique identifier for the given source file, comprised of |
| 29 | +/// the module and file name. |
| 30 | +@freestanding(expression) |
| 31 | +public macro fileID<T: ExpressibleByStringLiteral>() -> T = |
| 32 | + Builtin.FileIDMacro |
| 33 | + |
| 34 | +/// Produces the complete path for the given source file. |
| 35 | +@freestanding(expression) |
| 36 | +public macro filePath<T: ExpressibleByStringLiteral>() -> T = |
| 37 | + Builtin.FilePathMacro |
| 38 | + |
| 39 | +/// Produces either the result of `#filePath` or `#file`, depending |
| 40 | +/// on whether concise file paths (SE-0274) are enabled. |
| 41 | +@freestanding(expression) |
| 42 | +public macro file<T: ExpressibleByStringLiteral>() -> T = |
| 43 | + Builtin.FileMacro |
| 44 | + |
| 45 | +/// Produces a string representation of the current function name. |
| 46 | +@freestanding(expression) |
| 47 | +public macro function<T: ExpressibleByStringLiteral>() -> T = |
| 48 | + Builtin.FunctionMacro |
| 49 | + |
| 50 | +/// Produces the line number at which the macro is expanded. |
| 51 | +@freestanding(expression) |
| 52 | +public macro line<T: ExpressibleByIntegerLiteral>() -> T = |
| 53 | + Builtin.LineMacro |
| 54 | + |
| 55 | +/// Produces the column number at which the macro is expanded. |
| 56 | +@freestanding(expression) |
| 57 | +public macro column<T: ExpressibleByIntegerLiteral>() -> T = |
| 58 | + Builtin.ColumnMacro |
| 59 | + |
| 60 | +/// Produces the shared object handle for the macro expansion location. |
| 61 | +@freestanding(expression) |
| 62 | +public macro dsohandle() -> UnsafeRawPointer = Builtin.DSOHandleMacro |
0 commit comments