Skip to content

Commit

Permalink
sort: Only build FreeBSD-specific ALTMON_x stuff when ATLMON_1 is def…
Browse files Browse the repository at this point in the history
…ined

On MacOS, we bootstrap sort. Since ALTMON_* are not defined there, the
build blows up. Since we don't need this feature for the FreeBSD build
process, and since we won't use it unless we actually install the NL
files that have this data in it, just #ifdef it out for now. In the
extremely unlikely event that the FreeBSD bootstrap/build process grows
this dependency, we can evaluate the best solution then (which most
likely is going to be not depend on the local's month names).

Fixes:			3d44dce (MacOS builds and github CI)
Sponsored by:		Netflix
Reviewed by:		jrtc27, [email protected], markj
Differential Revision:	https://reviews.freebsd.org/D42868
  • Loading branch information
bsdimp committed Dec 7, 2023
1 parent 3e7e3b5 commit bd234c0
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions usr.bin/sort/bwstring.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,11 @@ initialise_months(void)
const nl_item ab_item[12] = { ABMON_1, ABMON_2, ABMON_3, ABMON_4,
ABMON_5, ABMON_6, ABMON_7, ABMON_8, ABMON_9, ABMON_10,
ABMON_11, ABMON_12 };
#ifdef ALTMON_1
const nl_item alt_item[12] = { ALTMON_1, ALTMON_2, ALTMON_3, ALTMON_4,
ALTMON_5, ALTMON_6, ALTMON_7, ALTMON_8, ALTMON_9, ALTMON_10,
ALTMON_11, ALTMON_12 };
#endif
int i;

/*
Expand All @@ -132,9 +134,13 @@ initialise_months(void)
if (!populate_cmonth(&cmonths[i].ab,
ab_item[i], i))
continue;
#ifdef ALTMON_1
if (!populate_cmonth(&cmonths[i].alt,
alt_item[i], i))
continue;
#else
cmonths[i].alt = NULL;
#endif
}
}

Expand All @@ -148,9 +154,13 @@ initialise_months(void)
if (!populate_wmonth(&wmonths[i].ab,
ab_item[i], i))
continue;
#ifdef ALTMON_1
if (!populate_wmonth(&wmonths[i].alt,
alt_item[i], i))
continue;
#else
wmonths[i].alt = NULL;
#endif
}
}
}
Expand Down

0 comments on commit bd234c0

Please sign in to comment.