| ... | ... | @@ -6978,6 +6978,21 @@ fn addCommonCCArgs( |
| 6978 | 6978 | // would be inconsistent with header declarations. |
| 6979 | 6979 | (min_ver.major * 100_000_000) + (min_ver.minor * 1_000_000), |
| 6980 | 6980 | })); |
| 6981 | } else if (target.isOpenBSDLibC()) { |
| 6982 | const min_ver = target.os.version_range.semver.min; |
| 6983 | // The macro in sys/param.h doesn't have the leading underscores, but we don't want to pollute the |
| 6984 | // global namespace in all compilation units. So we use leading underscores and modify sys/param.h |
| 6985 | // to just alias this one. |
| 6986 | try argv.append(try std.fmt.allocPrint(arena, "-D___OpenBSD={d}", .{ |
| 6987 | // Brilliantly, OpenBSD defines this macro to the year and month of the release, so we need to |
| 6988 | // maintain a manual mapping here whenever we update the headers. |
| 6989 | 202510, |
| 6990 | })); |
| 6991 | // We can't avoid pollution for this one... |
| 6992 | try argv.append(try std.fmt.allocPrint(arena, "-DOpenBSD{d}_{d}", .{ |
| 6993 | min_ver.major, |
| 6994 | min_ver.minor, |
| 6995 | })); |
| 6981 | 6996 | } |
| 6982 | 6997 | } |
| 6983 | 6998 | |