1
0
mirror of https://github.com/postgres/postgres.git synced 2025-04-18 13:44:19 +03:00

Define _POSIX_C_SOURCE as 200112L on Solaris.

This is an attempt to suppress some compiler warnings that appeared in
the wake of commit 7f798aca1: it seems that by default Solaris/illumos
declares shmdt() to take "char *" not "void *".  We'd like the system
headers to provide modern POSIX APIs, and POSIX 2001 seems to be as
modern as is available there.

illumos' standards(7) man page suggests that we might also need to
define __EXTENSIONS__, but let's see what happens with just this.

Discussion: https://postgr.es/m/1654508.1733162761@sss.pgh.pa.us
This commit is contained in:
Tom Lane 2024-12-03 12:44:43 -05:00
parent 3c5f9f12c8
commit 32a7deb2a0
3 changed files with 9 additions and 7 deletions

6
configure vendored
View File

@ -7590,10 +7590,10 @@ $as_echo "#define PROFILE_PID_DIR 1" >>confdefs.h
fi fi
fi fi
# On Solaris, we need this #define to get POSIX-conforming versions # On Solaris, we need these #defines to get POSIX-conforming versions
# of many interfaces (sigwait, getpwuid_r, ...). # of many interfaces (sigwait, getpwuid_r, shmdt, ...).
if test "$PORTNAME" = "solaris"; then if test "$PORTNAME" = "solaris"; then
CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS" CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=200112L -D_POSIX_PTHREAD_SEMANTICS"
fi fi
# We already have this in Makefile.win32, but configure needs it too # We already have this in Makefile.win32, but configure needs it too

View File

@ -693,10 +693,10 @@ if test "$enable_profiling" = yes && test "$ac_cv_prog_cc_g" = yes; then
fi fi
fi fi
# On Solaris, we need this #define to get POSIX-conforming versions # On Solaris, we need these #defines to get POSIX-conforming versions
# of many interfaces (sigwait, getpwuid_r, ...). # of many interfaces (sigwait, getpwuid_r, shmdt, ...).
if test "$PORTNAME" = "solaris"; then if test "$PORTNAME" = "solaris"; then
CPPFLAGS="$CPPFLAGS -D_POSIX_PTHREAD_SEMANTICS" CPPFLAGS="$CPPFLAGS -D_POSIX_C_SOURCE=200112L -D_POSIX_PTHREAD_SEMANTICS"
fi fi
# We already have this in Makefile.win32, but configure needs it too # We already have this in Makefile.win32, but configure needs it too

View File

@ -261,7 +261,9 @@ elif host_system == 'openbsd'
elif host_system == 'sunos' elif host_system == 'sunos'
portname = 'solaris' portname = 'solaris'
export_fmt = '-Wl,-M@0@' export_fmt = '-Wl,-M@0@'
cppflags += '-D_POSIX_PTHREAD_SEMANTICS' # We need these #defines to get POSIX-conforming versions
# of many interfaces (sigwait, getpwuid_r, shmdt, ...).
cppflags += [ '-D_POSIX_C_SOURCE=200112L', '-D_POSIX_PTHREAD_SEMANTICS' ]
elif host_system == 'windows' elif host_system == 'windows'
portname = 'win32' portname = 'win32'