empserver/m4/my_windows_api.m4
Markus Armbruster 9645a73bfb Fix portability bug in configure test for Windows API
The test uses an erroneous non-directive within #ifdef _WIN32 to
signal that _WIN32 is defined.  Some compilers choke on this even when
_WIN32 isn't defined.  Observed with FreeBSD 4.10's gcc 2.95.4.
Broken in commit c02468fd, v4.3.22.  Standaline client build already
broken in commit 774b590f, v4.3.17.

Use an unmatched brace instead.
2012-08-11 15:36:56 +02:00

20 lines
524 B
Text

AC_DEFUN([MY_WINDOWS_API],
[
AC_MSG_CHECKING([whether compiling for Windows API])
AC_COMPILE_IFELSE(
[AC_LANG_SOURCE([[#ifdef _WIN32
{ /* Here's a nickel, kid */
#endif]])],
[Windows_API=no],
[Windows_API=yes])
AC_MSG_RESULT([$Windows_API])
if test $Windows_API = yes; then
AC_DEFINE([WINDOWS], 1, [Define if compiling for Windows API])
AC_DEFINE([WIN32_LEAN_AND_MEAN], 1,
[Define to make Windows includes pull in less junk])
LIBS_SOCKETS="-lws2_32"
else
LIBS_SOCKETS=
fi
AC_SUBST([LIBS_SOCKETS])
])