These are used in a few places. Pass them to the generated .c and .h
files to allow us to build the parts of the interface the kernel config
supports.
Details
- Reviewers
imp jhb - Commits
- rGdc39a3346e7d: Make #if and #endif do what people expect in *_if.m
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
sys/tools/makeobjops.awk | ||
---|---|---|
469 | I'd be tempted here just to pass through all # lines. But if not, don't you also need #elif here? |
sys/tools/makeobjops.awk | ||
---|---|---|
469 | We can't pass them all through as they are used as comments in these files. I can add #elif, although we only ever use #if, #else and #endif in current .m files. |
sys/tools/makeobjops.awk | ||
---|---|---|
469 | Ah, right. I'm used to old-school cpp which ignored the directives it didn't understand :) Do we need to worry about #define and #undef too? |
sys/tools/makeobjops.awk | ||
---|---|---|
469 | I don't think so, those should be placed in the HEADER block which already passes everything through, e.g. as is done in sys/geom/raid/g_raid_tr_if.m |
I hadn't planned on a MFC as I'm unsure what .m files would break (and if there are any out of tree files I don't have access to)
I did some search on stable/13 trees:
find . -type f -name "*.m" -exec egrep '^#(if)|(^#else)|(^#elif)|(^#end)' {} \; -print #if __GNUC_PREREQ__(4,8) #endif #if __GNUC_PREREQ__(4,8) #endif #if __GNUC_PREREQ__(4,8) #endif ./contrib/netbsd-tests/lib/libobjc/t_threads.m #ifdef SMP #else #endif ./sys/powerpc/powerpc/platform_if.m #ifdef FDT #endif #ifdef FDT #endif ./sys/dev/extres/regulator/regdev_if.m #ifdef FDT #endif #ifdef FDT #endif ./sys/dev/extres/hwreset/hwreset_if.m #ifdef FDT #endif #ifdef FDT #endif ./sys/dev/extres/phy/phydev_if.m #ifdef FDT #endif ./sys/dev/xdma/xdma_if.m
I think it is right to MFC . It will fix sys/powerpc/powerpc/platform_if.m .
static struct cpu_group *platform_null_smp_topo(platform_t plat) { #ifdef SMP return (smp_topo_none()); #else return (NULL); #endif }
CC @jhibbits .
(and if there are any out of tree files I don't have access to)
I do not quite understand that. Do you mean some .m files in ports or third party ?