]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Support compiling the examples on native Windows without -loldnames.
authorBruno Haible <bruno@clisp.org>
Fri, 16 Sep 2022 17:27:45 +0000 (19:27 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 25 Sep 2022 19:53:45 +0000 (21:53 +0200)
* 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 <process.h>
and define getpid as an alias of _getpid. Otherwise, assume <unistd.h> 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.

20 files changed:
gettext-tools/examples/hello-c++-gnome/configure.ac
gettext-tools/examples/hello-c++-gnome/hello.cc
gettext-tools/examples/hello-c++-kde/configure.in.in
gettext-tools/examples/hello-c++-kde/hellowindow.cc
gettext-tools/examples/hello-c++-qt/configure.ac
gettext-tools/examples/hello-c++-qt/hello.cc
gettext-tools/examples/hello-c++-wxwidgets/configure.ac
gettext-tools/examples/hello-c++-wxwidgets/hello.cc
gettext-tools/examples/hello-c++/configure.ac
gettext-tools/examples/hello-c++/hello.cc
gettext-tools/examples/hello-c-gnome/configure.ac
gettext-tools/examples/hello-c-gnome/hello.c
gettext-tools/examples/hello-c-gnome3/configure.ac
gettext-tools/examples/hello-c-gnome3/hello.c
gettext-tools/examples/hello-c/configure.ac
gettext-tools/examples/hello-c/hello.c
gettext-tools/examples/hello-objc-gnome/configure.ac
gettext-tools/examples/hello-objc-gnome/hello.m
gettext-tools/examples/hello-objc/configure.ac
gettext-tools/examples/hello-objc/hello.m

index 32b20f794d3c48b8f5b8e9ff0e418c50c373856c..5ee556eb1b617e6c1c95d9428ece4aa40fd91098 100644 (file)
@@ -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])
 
index 6056083dc63c1adf69da920576941fe38f16cbb1..5c41ab3031197e46f1b338243ba43f796c26168d 100644 (file)
@@ -9,7 +9,12 @@
 #include <gtk--.h>
 
 /* Get getpid() declaration.  */
-#if HAVE_UNISTD_H
+#if defined _WIN32 && !defined __CYGWIN__
+/* native Windows API */
+# include <process.h>
+# define getpid _getpid
+#else
+/* POSIX API */
 # include <unistd.h>
 #endif
 
index abf4578ad4322e0fdc5d3235a9a8dd32912426d5..d5f26a626d6e56a2773f864e28d3eb22b1495a49 100644 (file)
@@ -1,5 +1,4 @@
 #MIN_CONFIG
-AC_CHECK_HEADERS([unistd.h])
 
 AM_GNU_GETTEXT([external])
 AM_GNU_GETTEXT_VERSION([0.21])
index 67aa2b44e6ee0ecb8fbdf4fa0c15b2aec9f4af2f..f6e341e6ba0192e8af429c23f38786b72c1ca946 100644 (file)
 #include <qhbox.h>
 
 /* Get getpid() declaration.  */
-#if HAVE_UNISTD_H
+#if defined _WIN32 && !defined __CYGWIN__
+/* native Windows API */
+# include <process.h>
+# define getpid _getpid
+#else
+/* POSIX API */
 # include <unistd.h>
 #endif
 
index 20e932477239146408e696141223c73abad663b7..5f5ad05a24d394d00728f6983c65fb6f636e9134 100644 (file)
@@ -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)
index 577a54e1b3e6ffc8ec87c0e2862931917111e325..25545903ac3c99d7a645a30dd4d4cb177a8e6dd7 100644 (file)
 #include <qtextcodec.h>
 
 /* Get getpid() declaration.  */
-#if HAVE_UNISTD_H
+#if defined _WIN32 && !defined __CYGWIN__
+/* native Windows API */
+# include <process.h>
+# define getpid _getpid
+#else
+/* POSIX API */
 # include <unistd.h>
 #endif
 
index cb4545131caec0a6715654b1706fec7ad30b64c9..8cb5d1489453d9ba7c9404ec8febb4fc08c874e4 100644 (file)
@@ -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])])
index 47191c79dbce56d68faec2067be26060d083bd71..258a3673e66220b7201d616cf3106929084348ad 100644 (file)
@@ -7,7 +7,12 @@
 #include <wx/intl.h>
 
 /* Get getpid() declaration.  */
-#if HAVE_UNISTD_H
+#if defined _WIN32 && !defined __CYGWIN__
+/* native Windows API */
+# include <process.h>
+# define getpid _getpid
+#else
+/* POSIX API */
 # include <unistd.h>
 #endif
 
index e80415659958c8d39e996ead976577434b050ec9..5ad9f0cdac78b53d22f11d24e216f1a3402b97c7 100644 (file)
@@ -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])
index 579490eed534bf5e26d61bf4f497d1ad40a50453..fe097df5393a98796c807d5c2f4007514e410b82 100644 (file)
@@ -16,7 +16,12 @@ using namespace std;
 #include <locale.h>
 
 // Get getpid() declaration.
-#if HAVE_UNISTD_H
+#if defined _WIN32 && !defined __CYGWIN__
+/* native Windows API */
+# include <process.h>
+# define getpid _getpid
+#else
+/* POSIX API */
 # include <unistd.h>
 #endif
 
index 764b62622750f00f0cb91b0f4e5108eb12b175ab..f4937b03ee03794bae7f17985671499720afe30c 100644 (file)
@@ -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])
 
index e7f5826bfd29a4088f37bab7735757f8ba042fd8..d175c3dfb6f1796bd7358b62d356973e127525b0 100644 (file)
@@ -8,7 +8,12 @@
 #include <gnome.h>
 
 /* Get getpid() declaration.  */
-#if HAVE_UNISTD_H
+#if defined _WIN32 && !defined __CYGWIN__
+/* native Windows API */
+# include <process.h>
+# define getpid _getpid
+#else
+/* POSIX API */
 # include <unistd.h>
 #endif
 
index fcb667758cd68115600502858b5dc39c5429b6bb..29360fad537b67eaa095197533f903ebd2fb6af8 100644 (file)
@@ -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])
 
index 56fbf6a22aa3111f226305c11a0285a8a1626127..569808e83350453abf62588b851ec218f2d2dc68 100644 (file)
@@ -9,7 +9,12 @@
 #include <glib/gi18n.h>
 
 /* Get getpid() declaration.  */
-#if HAVE_UNISTD_H
+#if defined _WIN32 && !defined __CYGWIN__
+/* native Windows API */
+# include <process.h>
+# define getpid _getpid
+#else
+/* POSIX API */
 # include <unistd.h>
 #endif
 
index 151926e8152a6891833e3fc438236edb6fcc9fdd..99e27eaa01fcc156e309a6c1173e52336633f9af 100644 (file)
@@ -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])
 
index 20be7f3b666886cbec6351ffef450eb9e5a7a478..a4a6278d4e7b1db504cb29adbc51f0fece7ec061 100644 (file)
 #include <stdio.h>
 
 /* Get getpid() declaration.  */
-#if HAVE_UNISTD_H
+#if defined _WIN32 && !defined __CYGWIN__
+/* native Windows API */
+# include <process.h>
+# define getpid _getpid
+#else
+/* POSIX API */
 # include <unistd.h>
 #endif
 
index fbe2ecfb85f8ef484195f49b3cb046001d50ea98..99b1495213ab811525a4365400c78f2f9d082526 100644 (file)
@@ -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])
 
index eb3a0bcc2aaa8aec7e98e7194dfbf3d702e70d17..cb3a7dbe1c6c579caac84ddd1e3988391b94c8ee 100644 (file)
@@ -8,7 +8,12 @@
 #include <obgnome/obgnome.h>
 
 /* Get getpid() declaration.  */
-#if HAVE_UNISTD_H
+#if defined _WIN32 && !defined __CYGWIN__
+/* native Windows API */
+# include <process.h>
+# define getpid _getpid
+#else
+/* POSIX API */
 # include <unistd.h>
 #endif
 
index ec1f1b098b58be13f2a05042a1ca8e7a1caba183..2384af7d17c0bc0cbda7aafe497d0d739104e1dd 100644 (file)
@@ -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])
 
index 1fca03eea3455a9467e722901a7ed0abafd0627e..88e0067b3f16c6a50120c4fc7b7e1366b2786b14 100644 (file)
 #include <stdio.h>
 
 /* Get getpid() declaration.  */
-#if HAVE_UNISTD_H
+#if defined _WIN32 && !defined __CYGWIN__
+/* native Windows API */
+# include <process.h>
+# define getpid _getpid
+#else
+/* POSIX API */
 # include <unistd.h>
 #endif