Re: WinCE/Pocket PC port for the C client library

From: "Magnus Hagander" <mha(at)sollentuna(dot)net>
To: "Nuno Lucas" <ntlucas(at)gmail(dot)com>, <pgsql-ports(at)postgresql(dot)org>
Subject: Re: WinCE/Pocket PC port for the C client library
Date: 2006-04-13 09:07:45
Message-ID: 6BCB9D8A16AC4241919521715F4D8BCEA352A4@algol.sollentuna.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-ports

> Hello,
>
> I'm implementing a WinCE 4.x (Pocket PC 2003) application
> which needs to get data from a postgres database, so I
> "hacked" the 8.1.2 libpq source so I could get it working.
>
> Well, it seems to be working ok, but, as I don't know the
> code, have no idea if my hack is acceptable or induces other
> bugs I haven't seen yet.

# add_file "src/include/pg_config.h"
# add_file "src/include/pg_config_paths.h"

This part certainly isn't right :-) Those files are supposed to be
auto-generated, not put in the source.

As for:
- if (getsockopt(conn->sock, SOL_SOCKET,
SO_ERROR,
- (char *)
&optval, &optlen) == -1)
+ int err = getsockopt(conn->sock,
SOL_SOCKET, SO_ERROR,
+
(char *) &optval, &optlen);
+#if defined(_WIN32_WCE)
+ /* This was "googled" from the curl
library source */
+ /* Always returns this error, bug in CE?
*/
+ if ( err == -1 && SOCK_ERRNO ==
WSAENOPROTOOPT )
+ err=0;
+#endif
+ if ( err == -1 )

Does it actually *have* the option and fail to set it, or is the option
just not there? If it doesn't exist, you should just #ifdef out the
tryign to set the option, IMHO.

Apart from that it looks OK to me. There definitly needs to be some
documentation on how to build it, though...

//Magnus

Responses

Browse pgsql-ports by date

  From Date Subject
Next Message Nuno Lucas 2006-04-13 09:41:27 Re: WinCE/Pocket PC port for the C client library
Previous Message Nuno Lucas 2006-04-13 08:50:13 WinCE/Pocket PC port for the C client library