From: Bruno Haible Date: Fri, 16 Sep 2022 17:27:45 +0000 (+0200) Subject: Support compiling the examples on native Windows without -loldnames. X-Git-Tag: v0.22~179 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=eb0ded32dbcd7bf6ccffc038509983ccca52631b;p=thirdparty%2Fgettext.git Support compiling the examples on native Windows without -loldnames. * gettext-tools/examples/hello-c/configure.ac: Don't test for unistd.h. * gettext-tools/examples/hello-c-gnome/configure.ac: Likewise. * gettext-tools/examples/hello-c-gnome3/configure.ac: Likewise. * gettext-tools/examples/hello-c++/configure.ac: Likewise. * gettext-tools/examples/hello-c++-qt/configure.ac: Likewise. * gettext-tools/examples/hello-c++-kde/configure.in.in: Likewise. * gettext-tools/examples/hello-c++-gnome/configure.ac: Likewise. * gettext-tools/examples/hello-c++-wxwidgets/configure.ac: Likewise. * gettext-tools/examples/hello-objc/configure.ac: Likewise. * gettext-tools/examples/hello-objc-gnome/configure.ac: Likewise. * gettext-tools/examples/hello-c/hello.c: On native Windows, include and define getpid as an alias of _getpid. Otherwise, assume exists. * gettext-tools/examples/hello-c-gnome/hello.c: Likewise. * gettext-tools/examples/hello-c-gnome3/hello.c: Likewise. * gettext-tools/examples/hello-c++/hello.cc: Likewise. * gettext-tools/examples/hello-c++-qt/hello.cc: Likewise. * gettext-tools/examples/hello-c++-kde/hellowindow.cc: Likewise. * gettext-tools/examples/hello-c++-gnome/hello.cc: Likewise. * gettext-tools/examples/hello-c++-wxwidgets/hello.cc: Likewise. * gettext-tools/examples/hello-objc/hello.m: Likewise. * gettext-tools/examples/hello-objc-gnome/hello.m: Likewise. --- diff --git a/gettext-tools/examples/hello-c++-gnome/configure.ac b/gettext-tools/examples/hello-c++-gnome/configure.ac index 32b20f794..5ee556eb1 100644 --- a/gettext-tools/examples/hello-c++-gnome/configure.ac +++ b/gettext-tools/examples/hello-c++-gnome/configure.ac @@ -15,7 +15,6 @@ AC_SUBST([GTKMM_CFLAGS]) GTKMM_LIBS=`gtkmm-config --libs` AC_SUBST([GTKMM_LIBS]) -AC_CHECK_HEADERS([unistd.h]) AM_GNU_GETTEXT([external]) AM_GNU_GETTEXT_VERSION([0.21]) diff --git a/gettext-tools/examples/hello-c++-gnome/hello.cc b/gettext-tools/examples/hello-c++-gnome/hello.cc index 6056083dc..5c41ab303 100644 --- a/gettext-tools/examples/hello-c++-gnome/hello.cc +++ b/gettext-tools/examples/hello-c++-gnome/hello.cc @@ -9,7 +9,12 @@ #include /* Get getpid() declaration. */ -#if HAVE_UNISTD_H +#if defined _WIN32 && !defined __CYGWIN__ +/* native Windows API */ +# include +# define getpid _getpid +#else +/* POSIX API */ # include #endif diff --git a/gettext-tools/examples/hello-c++-kde/configure.in.in b/gettext-tools/examples/hello-c++-kde/configure.in.in index abf4578ad..d5f26a626 100644 --- a/gettext-tools/examples/hello-c++-kde/configure.in.in +++ b/gettext-tools/examples/hello-c++-kde/configure.in.in @@ -1,5 +1,4 @@ #MIN_CONFIG -AC_CHECK_HEADERS([unistd.h]) AM_GNU_GETTEXT([external]) AM_GNU_GETTEXT_VERSION([0.21]) diff --git a/gettext-tools/examples/hello-c++-kde/hellowindow.cc b/gettext-tools/examples/hello-c++-kde/hellowindow.cc index 67aa2b44e..f6e341e6b 100644 --- a/gettext-tools/examples/hello-c++-kde/hellowindow.cc +++ b/gettext-tools/examples/hello-c++-kde/hellowindow.cc @@ -25,7 +25,12 @@ #include /* Get getpid() declaration. */ -#if HAVE_UNISTD_H +#if defined _WIN32 && !defined __CYGWIN__ +/* native Windows API */ +# include +# define getpid _getpid +#else +/* POSIX API */ # include #endif diff --git a/gettext-tools/examples/hello-c++-qt/configure.ac b/gettext-tools/examples/hello-c++-qt/configure.ac index 20e932477..5f5ad05a2 100644 --- a/gettext-tools/examples/hello-c++-qt/configure.ac +++ b/gettext-tools/examples/hello-c++-qt/configure.ac @@ -9,7 +9,6 @@ AM_INIT_AUTOMAKE([1.11]) AC_PROG_CXX FUN_TYPE_BOOL -AC_CHECK_HEADERS([unistd.h]) FUN_HEADER_STDCXX FUN_CHECK_PTHREAD FUN_CHECK_QT(220) diff --git a/gettext-tools/examples/hello-c++-qt/hello.cc b/gettext-tools/examples/hello-c++-qt/hello.cc index 577a54e1b..25545903a 100644 --- a/gettext-tools/examples/hello-c++-qt/hello.cc +++ b/gettext-tools/examples/hello-c++-qt/hello.cc @@ -13,7 +13,12 @@ #include /* Get getpid() declaration. */ -#if HAVE_UNISTD_H +#if defined _WIN32 && !defined __CYGWIN__ +/* native Windows API */ +# include +# define getpid _getpid +#else +/* POSIX API */ # include #endif diff --git a/gettext-tools/examples/hello-c++-wxwidgets/configure.ac b/gettext-tools/examples/hello-c++-wxwidgets/configure.ac index cb4545131..8cb5d1489 100644 --- a/gettext-tools/examples/hello-c++-wxwidgets/configure.ac +++ b/gettext-tools/examples/hello-c++-wxwidgets/configure.ac @@ -8,7 +8,6 @@ AC_CONFIG_SRCDIR([hello.cc]) AM_INIT_AUTOMAKE([1.11]) AC_PROG_CXX -AC_CHECK_HEADERS([unistd.h]) AM_OPTIONS_WXCONFIG AM_PATH_WXCONFIG([2.6.0], [], [AC_MSG_ERROR([wxWidgets not found])]) diff --git a/gettext-tools/examples/hello-c++-wxwidgets/hello.cc b/gettext-tools/examples/hello-c++-wxwidgets/hello.cc index 47191c79d..258a3673e 100644 --- a/gettext-tools/examples/hello-c++-wxwidgets/hello.cc +++ b/gettext-tools/examples/hello-c++-wxwidgets/hello.cc @@ -7,7 +7,12 @@ #include /* Get getpid() declaration. */ -#if HAVE_UNISTD_H +#if defined _WIN32 && !defined __CYGWIN__ +/* native Windows API */ +# include +# define getpid _getpid +#else +/* POSIX API */ # include #endif diff --git a/gettext-tools/examples/hello-c++/configure.ac b/gettext-tools/examples/hello-c++/configure.ac index e80415659..5ad9f0cda 100644 --- a/gettext-tools/examples/hello-c++/configure.ac +++ b/gettext-tools/examples/hello-c++/configure.ac @@ -8,7 +8,6 @@ AC_CONFIG_SRCDIR([hello.cc]) AM_INIT_AUTOMAKE([1.11]) AC_PROG_CXX -AC_CHECK_HEADERS([unistd.h]) AM_GNU_GETTEXT([external]) AM_GNU_GETTEXT_VERSION([0.21]) AC_LIB_LINKFLAGS([asprintf]) diff --git a/gettext-tools/examples/hello-c++/hello.cc b/gettext-tools/examples/hello-c++/hello.cc index 579490eed..fe097df53 100644 --- a/gettext-tools/examples/hello-c++/hello.cc +++ b/gettext-tools/examples/hello-c++/hello.cc @@ -16,7 +16,12 @@ using namespace std; #include // Get getpid() declaration. -#if HAVE_UNISTD_H +#if defined _WIN32 && !defined __CYGWIN__ +/* native Windows API */ +# include +# define getpid _getpid +#else +/* POSIX API */ # include #endif diff --git a/gettext-tools/examples/hello-c-gnome/configure.ac b/gettext-tools/examples/hello-c-gnome/configure.ac index 764b62622..f4937b03e 100644 --- a/gettext-tools/examples/hello-c-gnome/configure.ac +++ b/gettext-tools/examples/hello-c-gnome/configure.ac @@ -9,7 +9,6 @@ AM_INIT_AUTOMAKE([1.11]) AC_PROG_CC GNOME_INIT -AC_CHECK_HEADERS([unistd.h]) AM_GNU_GETTEXT([external]) AM_GNU_GETTEXT_VERSION([0.21]) diff --git a/gettext-tools/examples/hello-c-gnome/hello.c b/gettext-tools/examples/hello-c-gnome/hello.c index e7f5826bf..d175c3dfb 100644 --- a/gettext-tools/examples/hello-c-gnome/hello.c +++ b/gettext-tools/examples/hello-c-gnome/hello.c @@ -8,7 +8,12 @@ #include /* Get getpid() declaration. */ -#if HAVE_UNISTD_H +#if defined _WIN32 && !defined __CYGWIN__ +/* native Windows API */ +# include +# define getpid _getpid +#else +/* POSIX API */ # include #endif diff --git a/gettext-tools/examples/hello-c-gnome3/configure.ac b/gettext-tools/examples/hello-c-gnome3/configure.ac index fcb667758..29360fad5 100644 --- a/gettext-tools/examples/hello-c-gnome3/configure.ac +++ b/gettext-tools/examples/hello-c-gnome3/configure.ac @@ -8,7 +8,6 @@ AC_CONFIG_SRCDIR([hello.c]) AM_INIT_AUTOMAKE([1.11]) AC_PROG_CC -AC_CHECK_HEADERS([unistd.h]) AM_GNU_GETTEXT([external]) AM_GNU_GETTEXT_VERSION([0.21]) diff --git a/gettext-tools/examples/hello-c-gnome3/hello.c b/gettext-tools/examples/hello-c-gnome3/hello.c index 56fbf6a22..569808e83 100644 --- a/gettext-tools/examples/hello-c-gnome3/hello.c +++ b/gettext-tools/examples/hello-c-gnome3/hello.c @@ -9,7 +9,12 @@ #include /* Get getpid() declaration. */ -#if HAVE_UNISTD_H +#if defined _WIN32 && !defined __CYGWIN__ +/* native Windows API */ +# include +# define getpid _getpid +#else +/* POSIX API */ # include #endif diff --git a/gettext-tools/examples/hello-c/configure.ac b/gettext-tools/examples/hello-c/configure.ac index 151926e81..99e27eaa0 100644 --- a/gettext-tools/examples/hello-c/configure.ac +++ b/gettext-tools/examples/hello-c/configure.ac @@ -8,7 +8,6 @@ AC_CONFIG_SRCDIR([hello.c]) AM_INIT_AUTOMAKE([1.11]) AC_PROG_CC -AC_CHECK_HEADERS([unistd.h]) AM_GNU_GETTEXT([external]) AM_GNU_GETTEXT_VERSION([0.21]) diff --git a/gettext-tools/examples/hello-c/hello.c b/gettext-tools/examples/hello-c/hello.c index 20be7f3b6..a4a6278d4 100644 --- a/gettext-tools/examples/hello-c/hello.c +++ b/gettext-tools/examples/hello-c/hello.c @@ -11,7 +11,12 @@ #include /* Get getpid() declaration. */ -#if HAVE_UNISTD_H +#if defined _WIN32 && !defined __CYGWIN__ +/* native Windows API */ +# include +# define getpid _getpid +#else +/* POSIX API */ # include #endif diff --git a/gettext-tools/examples/hello-objc-gnome/configure.ac b/gettext-tools/examples/hello-objc-gnome/configure.ac index fbe2ecfb8..99b149521 100644 --- a/gettext-tools/examples/hello-objc-gnome/configure.ac +++ b/gettext-tools/examples/hello-objc-gnome/configure.ac @@ -19,7 +19,6 @@ if test -n "$obgnome_prefix"; then fi AC_SUBST([OBGNOME_INCLUDES]) -AC_CHECK_HEADERS([unistd.h]) AM_GNU_GETTEXT([external]) AM_GNU_GETTEXT_VERSION([0.21]) diff --git a/gettext-tools/examples/hello-objc-gnome/hello.m b/gettext-tools/examples/hello-objc-gnome/hello.m index eb3a0bcc2..cb3a7dbe1 100644 --- a/gettext-tools/examples/hello-objc-gnome/hello.m +++ b/gettext-tools/examples/hello-objc-gnome/hello.m @@ -8,7 +8,12 @@ #include /* Get getpid() declaration. */ -#if HAVE_UNISTD_H +#if defined _WIN32 && !defined __CYGWIN__ +/* native Windows API */ +# include +# define getpid _getpid +#else +/* POSIX API */ # include #endif diff --git a/gettext-tools/examples/hello-objc/configure.ac b/gettext-tools/examples/hello-objc/configure.ac index ec1f1b098..2384af7d1 100644 --- a/gettext-tools/examples/hello-objc/configure.ac +++ b/gettext-tools/examples/hello-objc/configure.ac @@ -9,7 +9,6 @@ AM_INIT_AUTOMAKE([1.11]) AC_PROG_CC AC_SUBST([OBJC], ["$CC"]) -AC_CHECK_HEADERS([unistd.h]) AM_GNU_GETTEXT([external]) AM_GNU_GETTEXT_VERSION([0.21]) diff --git a/gettext-tools/examples/hello-objc/hello.m b/gettext-tools/examples/hello-objc/hello.m index 1fca03eea..88e0067b3 100644 --- a/gettext-tools/examples/hello-objc/hello.m +++ b/gettext-tools/examples/hello-objc/hello.m @@ -11,7 +11,12 @@ #include /* Get getpid() declaration. */ -#if HAVE_UNISTD_H +#if defined _WIN32 && !defined __CYGWIN__ +/* native Windows API */ +# include +# define getpid _getpid +#else +/* POSIX API */ # include #endif