Re: [PATCH v2 6/8] Refactor devices build
Pawel Kot <[email protected]> Mon, 13 Jan 2020 19:52:20 +0100
| Newsgroups | gmane.linux.drivers.gnokii |
|---|---|
| Message-ID | <CAHytCw46vWpMLRgT5HoJjvow_aEV_N1iS0_+GycAb9GEjA408g@mail.gmail.com> |
--===============3684860880781993962== Content-Type: multipart/alternative; boundary="00000000000045ec88059c09fa00" --00000000000045ec88059c09fa00 Content-Type: text/plain; charset="UTF-8" Hi, On Tue, Dec 4, 2018 at 10:32 PM Ladislav Michl <[email protected]> wrote: > Remove #ifdefs from device drivers and compile them only when > selected. Once there, move device detection code in configure.ac > to live in one place. I'm fine with the overall logic but there are some bits that I do not like. > common/devices/osxbluetooth.m | 8 +- Why .m? > +#else > + > +int bluetooth_open(const char *addr, uint8_t channel, struct gn_statemachine *state) > +{ > + return -1; > +} > + > +int bluetooth_close(int fd, struct gn_statemachine *state) > +{ > + return -1; > +} > + > +int bluetooth_write(int fd, const __ptr_t bytes, int size, struct gn_statemachine *state) > +{ > + return -1; > +} > + > +int bluetooth_read(int fd, __ptr_t bytes, int size, struct gn_statemachine *state) > +{ > + return -1; > +} > + > +int bluetooth_select(int fd, struct timeval *timeout, struct gn_statemachine *state) > +{ > + return -1; > +} > + > +#endif This I really do not like and would like to avoid having it in the header files. Cheers, -- Pawel Kot --00000000000045ec88059c09fa00 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">Hi,<br><br>On Tue, Dec 4, 2018 at 10:32 PM Ladislav Michl = <<a href=3D"mailto:[email protected]">[email protected]</a>> wr= ote:<br>> Remove #ifdefs from device drivers and compile them only when<= br>> selected. Once there, move device detection code in <a href=3D"http= ://configure.ac">configure.ac</a><br>> to live in one place.<div><br></d= iv><div>I'm fine with the overall logic but there are some bits that I = do not like.</div><div><br>> =C2=A0common/devices/osxbluetooth.m =C2=A0 = =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 | =C2=A0 8 +-</div><div><b= r></div><div>Why .m?</div><div><br>> +#else<br>> +<br>> +int bluet= ooth_open(const char *addr, uint8_t channel, struct gn_statemachine *state)= <br>> +{<br>> + =C2=A0 =C2=A0 =C2=A0 return -1;<br>> +}<br>> +<= br>> +int bluetooth_close(int fd, struct gn_statemachine *state)<br>>= +{<br>> + =C2=A0 =C2=A0 =C2=A0 return -1;<br>> +}<br>> +<br>> = +int bluetooth_write(int fd, const __ptr_t bytes, int size, struct gn_state= machine *state)<br>> +{<br>> + =C2=A0 =C2=A0 =C2=A0 return -1;<br>>= ; +}<br>> +<br>> +int bluetooth_read(int fd, __ptr_t bytes, int size,= struct gn_statemachine *state)<br>> +{<br>> + =C2=A0 =C2=A0 =C2=A0 r= eturn -1;<br>> +}<br>> +<br>> +int bluetooth_select(int fd, struct= timeval *timeout, struct gn_statemachine *state)<br>> +{<br>> + =C2= =A0 =C2=A0 =C2=A0 return -1;<br>> +}<br>> +<br>> +#endif<br><br>Th= is I really do not like and would like to avoid having it in the header fil= es.<br><br>Cheers,</div><div>--<br>Pawel Kot</div></div> --00000000000045ec88059c09fa00-- --===============3684860880781993962== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZ25va2lpLXVz ZXJzIG1haWxpbmcgbGlzdApnbm9raWktdXNlcnNAbm9uZ251Lm9yZwpodHRwczovL2xpc3RzLm5v bmdudS5vcmcvbWFpbG1hbi9saXN0aW5mby9nbm9raWktdXNlcnMK --===============3684860880781993962==--