Обсуждение: src/test/examples/testlibpq2.c where the HAVE_SYS_SELECT_H is defined.

Поиск
Список
Период
Сортировка

src/test/examples/testlibpq2.c where the HAVE_SYS_SELECT_H is defined.

От
jian he
Дата:

Hi,
playing around with $[0] testlibpq2.c example. I wondered where HAVE_SYS_SELECT_H is defined?

I searched on the internet, founded that people also asked the same question in $[1].

In my machine, I do have <sys/select.h>.
system version: Ubuntu 22.04.1 LTS
gcc version: gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
gcc compile command: gcc pg_testlibpq2.c -I/home/jian/postgres/pg16/include \
-L/home/jian/postgres/pg16/lib -lpq

Re: src/test/examples/testlibpq2.c where the HAVE_SYS_SELECT_H is defined.

От
Thomas Munro
Дата:
On Fri, Mar 17, 2023 at 7:48 PM jian he <jian.universality@gmail.com> wrote:
> Hi,
> playing around with $[0] testlibpq2.c example. I wondered where HAVE_SYS_SELECT_H is defined?
>
> I searched on the internet, founded that people also asked the same question in $[1].
>
> In my machine, I do have <sys/select.h>.
> system version: Ubuntu 22.04.1 LTS
> gcc version: gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
> gcc compile command: gcc pg_testlibpq2.c -I/home/jian/postgres/pg16/include \
> -L/home/jian/postgres/pg16/lib -lpq
>
> [0]https://www.postgresql.org/docs/current/libpq-example.html
>
[1]https://stackoverflow.com/questions/37876850/in-compilation-time-how-to-find-the-macro-is-defined-in-which-header-file

In 15 and earlier, it is defined in pg_config.h, which is created by
configure.  But in 16, that particular macro was removed by commit
7e50b4e3c.  It looks like you are using PostgreSQL 16 sources, but
looking at PostgreSQL 15 examples?



Re: src/test/examples/testlibpq2.c where the HAVE_SYS_SELECT_H is defined.

От
jian he
Дата:

Yes, you are right. my mistake. I should choose the manual dev version. 

On Fri, Mar 17, 2023 at 4:12 PM Thomas Munro <thomas.munro@gmail.com> wrote:
On Fri, Mar 17, 2023 at 7:48 PM jian he <jian.universality@gmail.com> wrote:
> Hi,
> playing around with $[0] testlibpq2.c example. I wondered where HAVE_SYS_SELECT_H is defined?
>
> I searched on the internet, founded that people also asked the same question in $[1].
>
> In my machine, I do have <sys/select.h>.
> system version: Ubuntu 22.04.1 LTS
> gcc version: gcc (Ubuntu 11.3.0-1ubuntu1~22.04) 11.3.0
> gcc compile command: gcc pg_testlibpq2.c -I/home/jian/postgres/pg16/include \
> -L/home/jian/postgres/pg16/lib -lpq
>
> [0]https://www.postgresql.org/docs/current/libpq-example.html
> [1]https://stackoverflow.com/questions/37876850/in-compilation-time-how-to-find-the-macro-is-defined-in-which-header-file

In 15 and earlier, it is defined in pg_config.h, which is created by
configure.  But in 16, that particular macro was removed by commit
7e50b4e3c.  It looks like you are using PostgreSQL 16 sources, but
looking at PostgreSQL 15 examples?


--
 I recommend David Deutsch's <<The Beginning of Infinity>>

  Jian