Skip site navigation (1) Skip section navigation (2)

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

From: "Nuno Lucas" <ntlucas(at)gmail(dot)com>
To: "Magnus Hagander" <mha(at)sollentuna(dot)net>
Cc: pgsql-ports(at)postgresql(dot)org
Subject: Re: WinCE/Pocket PC port for the C client library
Date: 2006-04-13 09:41:27
Message-ID: c4f20e170604130241w58bfc8adua973f88562e43e77@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-ports
On 4/13/06, Magnus Hagander <mha(at)sollentuna(dot)net> wrote:
> # 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.

Right. It's here just for convenience and because there is no chance
of autogenerating those (no autoconf port that I know of will ever
understand a WinCE target).

Maybe they should be already generated with some other name (e.g.,
pg_config_wince.h) and some readme telling users to rename/move them
to the right place.

> 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.

I really have no idea.
It seems it accepts the option, but always returns the error when
checking for it on WinCE.
After I tried googling for it I discovered the curl library port for
WinCE also checks for that error and ignores it (on WinCE).

I was hoping some WinCE sockets "guru" could explain that to me ;-)

A link to some curl library source I found with google is here:
http://cool.haxx.se/cvs.cgi/curl/lib/connect.c?rev=1.120&content-type=text/vnd.viewcvs-markup

Look for the verifyconnect() static function and you'll notice their use.

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

Yeah, that's why I included the eVC 4 project files, which include
projects for building it as static library and as a DLL.

For those that know it's way around the eVC compiler it should be easy
enough to see what files need to be included on the project.

As I'm not an english native speaker I was hopping some interested
user would help in the documentation.

Best regards,
~Nuno Lucas

P.S.- I had an old sourceforge project when I ported SQLite for WinCE
(which is now part of the official source) and as the SQLmd is also a
SQLite utility program, I put the source there (instead of in my
bandwidth limited home server).

You can get the source here:
http://sourceforge.net/project/showfiles.php?group_id=88393&package_id=187273&release_id=409524


>
> //Magnus
>

In response to

pgsql-ports by date

Next:From: Michael ArtzDate: 2006-04-27 10:37:52
Subject: Regression test errors on x86_64
Previous:From: Magnus HaganderDate: 2006-04-13 09:07:45
Subject: Re: WinCE/Pocket PC port for the C client library

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group