| ... | @@ -1898,6 +1898,16 @@ pub const LoadCommandIterator = struct { | ... | @@ -1898,6 +1898,16 @@ pub const LoadCommandIterator = struct { |
| 1898 | const data = lc.data[rpath_lc.path..]; | 1898 | const data = lc.data[rpath_lc.path..]; |
| 1899 | return mem.sliceTo(data, 0); | 1899 | return mem.sliceTo(data, 0); |
| 1900 | } | 1900 | } |
| | 1901 | |
| | 1902 | /// Asserts LoadCommand is of type build_version_command. |
| | 1903 | pub fn getBuildVersionTools(lc: LoadCommand) []const build_tool_version { |
| | 1904 | const build_lc = lc.cast(build_version_command).?; |
| | 1905 | const ntools = build_lc.ntools; |
| | 1906 | if (ntools == 0) return &[0]build_tool_version{}; |
| | 1907 | const data = lc.data[@sizeOf(build_version_command)..]; |
| | 1908 | const tools = @as([*]const build_tool_version, @ptrCast(@alignCast(&data[0])))[0..ntools]; |
| | 1909 | return tools; |
| | 1910 | } |
| 1901 | }; | 1911 | }; |
| 1902 | | 1912 | |
| 1903 | pub fn next(it: *LoadCommandIterator) ?LoadCommand { | 1913 | pub fn next(it: *LoadCommandIterator) ?LoadCommand { |