[3.11] gh-78469: Declare missing sethostname for Solaris 10 (GH-10944… · python/cpython@1942721 · GitHub
Skip to content

Commit 1942721

Browse files
[3.11] gh-78469: Declare missing sethostname for Solaris 10 (GH-109447) (#110581)
Add OS version specific macro for Solaris: Py_SUNOS_VERSION. (cherry picked from commit 3b1580a) Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
1 parent 2b3a418 commit 1942721

4 files changed

Lines changed: 25 additions & 2 deletions

File tree

Modules/socketmodule.c

Lines changed: 3 additions & 2 deletions

configure

Lines changed: 11 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,14 @@ then
582582
darwin*) MACHDEP="darwin";;
583583
'') MACHDEP="unknown";;
584584
esac
585+
586+
if test "$ac_sys_system" = "SunOS"; then
587+
# For Solaris, there isn't an OS version specific macro defined
588+
# in most compilers, so we define one here.
589+
SUNOS_VERSION=`echo $ac_sys_release | sed -e 's!\.\([0-9]\)$!.0\1!g' | tr -d '.'`
590+
AC_DEFINE_UNQUOTED([Py_SUNOS_VERSION], [$SUNOS_VERSION],
591+
[The version of SunOS/Solaris as reported by `uname -r' without the dot.])
592+
fi
585593
fi
586594
AC_MSG_RESULT("$MACHDEP")
587595

pyconfig.h.in

Lines changed: 3 additions & 0 deletions

0 commit comments

Comments
 (0)