Re: [PATCH v2 07/12] fsmonitor: prepare to share code between Mac OS and Linux
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Oct 18, 2022, 06:31 UTC
- Message-ID
- <xmqqa65twsln.fsf@gitster.g>
- In-Reply-To
- <BL0PR05MB557147E13EFF24F664A14832D9299@BL0PR05MB5571.namprd05.prod.outlook.com>
Eric DeCosta <edecosta@mathworks.com> writes:
Show 16 quoted lines
>> Ugly. >> >> One overrides backend with common, while the other one doesn't. >> That asymmetry alone should stop us and wonder if there is something fishy >> in the approach that can be improved. It makes it look like the word >> "common" means something quite different between the -ipc and the - >> settings world. >> >> I suspect that in both, you should not expose "unix" to this part of the >> Makefile. Linux and macOS occasionally being similar in some places does >> not have to be exposed here. INstead you can use backend "linux" and >> "macos", whose C sources may include from a separate C source file whose >> name may contain "unix". That would allow you to get rid of >> FSMONITOR_DAEMON_COMMON in a cleaner way. > > Let me see if I am understanding you correctly. Are you suggesting something like:
Not really.
What I had in mind was an arrangement more like
$ for variant in linux macos; do grep include fsm-ipc-$variant.c; done
#include "fsm-ipc-common-unix.cinclude"
#include "fsm-ipc-common-unix.cinclude"and COMPAT_OBJS knowning only about fsm-ipc-linux.o or fsm-ipc-macos.o, depending on which platform you are building.