Re: [PATCH 0/9] Refactor devices build

Pawel Kot <[email protected]> Tue, 28 Jan 2020 01:50:08 +0300
Newsgroups gmane.linux.drivers.gnokii
Message-ID <CAHytCw7dHP2X_c2zWhzDVv2cKh4h0fZfGxPSHWazXWJOg0iOxQ@mail.gmail.com>
--===============8425193206085787762==
Content-Type: multipart/alternative; boundary="00000000000084c34a059d26eee0"

--00000000000084c34a059d26eee0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi,

On Mon, 27 Jan 2020 at 23:41, Ladislav Michl <[email protected]> wrote:

> Hi Pawel,
>
> On Sun, Jan 26, 2020 at 11:59:47PM +0100, Pawel Kot wrote:
> > Thanks. I will be looking into these over a couple of next days.
> Meanwhile
> > I've pushed some changes required to (almost) compile successfully unde=
r
> > Microsoft Visual Studio. Seems it doesn't break thinks under Linux and
> OS X.
>
> Now looking at you changes... The snippet


Thanks for looking into it :)

#ifndef ssize_t
> #  include <basetsd.h>
> #  define ssize_t SSIZE_T
> #endif
> in snprintf.c does not look nice to me. I would:


Does not look nice to me either. Was actually pushing it to find some
better ideas.

1) put it into compat.h, to keep changes to upstream snprintf.c minimal.


I would not do this. I=E2=80=99d like to keep common.h to include common th=
ings.
I.e. frequently used. To be honest I think we have excessive stuff there.

2) use #if defined(_MSC_VER) to guard it (or combine with HAVE_SSIZE_T?)


That sounds much better.

3) or something like this:
> --- a/include/compat.h
> +++ b/include/compat.h
> @@ -20,6 +20,8 @@
>
>  #ifdef HAVE_CONFIG_H
>  #  include "config.h"
> +#elif defined(_MSC_VER)
> +#  include "msvc-config.h"
>  #else
>  #  error "compat.h requires config.h"
>  #endif
> and solve Microsoft Visual Studio in it's own config. It could be even


Not sure about combining it with compat.h. I think separate header included
where needed would work. Let me look at all things that would go there.

versioned. Also sorry for not finding time to look at win32 stuff yet.


Obviously - no worries here ;)

Cheers
Pawe=C5=82
--=20
Pawel Kot

--00000000000084c34a059d26eee0
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div><div><div dir=3D"auto">Hi,</div></div><div><br><div class=3D"gmail_quo=
te"></div></div></div><div><div dir=3D"ltr" class=3D"gmail_attr">On Mon, 27=
 Jan 2020 at 23:41, Ladislav Michl &lt;<a href=3D"mailto:[email protected]=
rg" target=3D"_blank">[email protected]</a>&gt; wrote:<br></div><blockqu=
ote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc s=
olid;padding-left:1ex">Hi Pawel,<br>
<br>
On Sun, Jan 26, 2020 at 11:59:47PM +0100, Pawel Kot wrote:<br>
&gt; Thanks. I will be looking into these over a couple of next days. Meanw=
hile<br>
&gt; I&#39;ve pushed some changes required to (almost) compile successfully=
 under<br>
&gt; Microsoft Visual Studio. Seems it doesn&#39;t break thinks under Linux=
 and OS X.<br>
<br>
Now looking at you changes... The snippet</blockquote><div dir=3D"auto"><br=
></div></div><div><div dir=3D"auto">Thanks for looking into it :)</div></di=
v><div><div dir=3D"auto"><br></div><blockquote class=3D"gmail_quote" style=
=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
#ifndef ssize_t<br>
#=C2=A0 include &lt;basetsd.h&gt;<br>
#=C2=A0 define ssize_t SSIZE_T<br>
#endif<br>
in snprintf.c does not look nice to me. I would:</blockquote><div dir=3D"au=
to"><br></div></div><div><div dir=3D"auto">Does not look nice to me either.=
 Was actually pushing it to find some better ideas.</div></div><div><div di=
r=3D"auto"><br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 =
0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
1) put it into compat.h, to keep changes to upstream snprintf.c minimal.</b=
lockquote><div dir=3D"auto"><br></div></div><div><div dir=3D"auto">I would =
not do this. I=E2=80=99d like to keep common.h to include common things. I.=
e. frequently used. To be honest I think we have excessive stuff there.</di=
v></div><div><div dir=3D"auto"><br></div><blockquote class=3D"gmail_quote" =
style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
2) use #if defined(_MSC_VER) to guard it (or combine with HAVE_SSIZE_T?)</b=
lockquote><div dir=3D"auto"><br></div></div><div><div dir=3D"auto">That sou=
nds much better.</div></div><div><div dir=3D"auto"><br></div><blockquote cl=
ass=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;p=
adding-left:1ex">
3) or something like this:<br>
--- a/include/compat.h<br>
+++ b/include/compat.h<br>
@@ -20,6 +20,8 @@<br>
<br>
=C2=A0#ifdef HAVE_CONFIG_H<br>
=C2=A0#=C2=A0 include &quot;config.h&quot;<br>
+#elif defined(_MSC_VER)<br>
+#=C2=A0 include &quot;msvc-config.h&quot;<br>
=C2=A0#else<br>
=C2=A0#=C2=A0 error &quot;compat.h requires config.h&quot;<br>
=C2=A0#endif<br>
and solve Microsoft Visual Studio in it&#39;s own config. It could be even<=
/blockquote><div dir=3D"auto"><br></div></div><div><div dir=3D"auto">Not su=
re about combining it with compat.h. I think separate header included where=
 needed would work. Let me look at all things that would go there.</div></d=
iv><div dir=3D"auto"><br></div><div><div><div class=3D"gmail_quote"><blockq=
uote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc =
solid;padding-left:1ex">
versioned. Also sorry for not finding time to look at win32 stuff yet.</blo=
ckquote><div dir=3D"auto"><br></div><div dir=3D"auto">Obviously - no worrie=
s here ;)</div><div dir=3D"auto"><br></div><div dir=3D"auto">Cheers</div><d=
iv dir=3D"auto">Pawe=C5=82=C2=A0</div></div></div>
</div>-- <br><div dir=3D"ltr" class=3D"gmail_signature" data-smartmail=3D"g=
mail_signature">Pawel Kot</div>

--00000000000084c34a059d26eee0--


--===============8425193206085787762==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline

X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZ25va2lpLXVz
ZXJzIG1haWxpbmcgbGlzdApnbm9raWktdXNlcnNAbm9uZ251Lm9yZwpodHRwczovL2xpc3RzLm5v
bmdudS5vcmcvbWFpbG1hbi9saXN0aW5mby9nbm9raWktdXNlcnMK

--===============8425193206085787762==--