mirror of https://github.com/python/cpython
gh-78469: Declare missing sethostname for Solaris 10 (#109447)
Add OS version specific macro for Solaris: Py_SUNOS_VERSION.
This commit is contained in:
parent
0050670d76
commit
3b1580af07
|
@ -5652,8 +5652,9 @@ socket_sethostname(PyObject *self, PyObject *args)
|
||||||
Py_buffer buf;
|
Py_buffer buf;
|
||||||
int res, flag = 0;
|
int res, flag = 0;
|
||||||
|
|
||||||
#ifdef _AIX
|
#if defined(_AIX) || (defined(__sun) && defined(__SVR4) && Py_SUNOS_VERSION <= 510)
|
||||||
/* issue #18259, not declared in any useful header file */
|
/* issue #18259, sethostname is not declared in any useful header file on AIX
|
||||||
|
* the same is true for Solaris 10 */
|
||||||
extern int sethostname(const char *, size_t);
|
extern int sethostname(const char *, size_t);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -4284,6 +4284,15 @@ then
|
||||||
darwin*) MACHDEP="darwin";;
|
darwin*) MACHDEP="darwin";;
|
||||||
'') MACHDEP="unknown";;
|
'') MACHDEP="unknown";;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
if test "$ac_sys_system" = "SunOS"; then
|
||||||
|
# For Solaris, there isn't an OS version specific macro defined
|
||||||
|
# in most compilers, so we define one here.
|
||||||
|
SUNOS_VERSION=`echo $ac_sys_release | sed -e 's!\.\(0-9\)$!.0\1!g' | tr -d '.'`
|
||||||
|
|
||||||
|
printf "%s\n" "#define Py_SUNOS_VERSION $SUNOS_VERSION" >>confdefs.h
|
||||||
|
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: \"$MACHDEP\"" >&5
|
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: \"$MACHDEP\"" >&5
|
||||||
printf "%s\n" "\"$MACHDEP\"" >&6; }
|
printf "%s\n" "\"$MACHDEP\"" >&6; }
|
||||||
|
|
|
@ -590,6 +590,14 @@ then
|
||||||
darwin*) MACHDEP="darwin";;
|
darwin*) MACHDEP="darwin";;
|
||||||
'') MACHDEP="unknown";;
|
'') MACHDEP="unknown";;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
if test "$ac_sys_system" = "SunOS"; then
|
||||||
|
# For Solaris, there isn't an OS version specific macro defined
|
||||||
|
# in most compilers, so we define one here.
|
||||||
|
SUNOS_VERSION=`echo $ac_sys_release | sed -e 's!\.\([0-9]\)$!.0\1!g' | tr -d '.'`
|
||||||
|
AC_DEFINE_UNQUOTED([Py_SUNOS_VERSION], [$SUNOS_VERSION],
|
||||||
|
[The version of SunOS/Solaris as reported by `uname -r' without the dot.])
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
AC_MSG_RESULT(["$MACHDEP"])
|
AC_MSG_RESULT(["$MACHDEP"])
|
||||||
|
|
||||||
|
|
|
@ -1621,6 +1621,9 @@
|
||||||
/* Define if you want to enable internal statistics gathering. */
|
/* Define if you want to enable internal statistics gathering. */
|
||||||
#undef Py_STATS
|
#undef Py_STATS
|
||||||
|
|
||||||
|
/* The version of SunOS/Solaris as reported by `uname -r' without the dot. */
|
||||||
|
#undef Py_SUNOS_VERSION
|
||||||
|
|
||||||
/* Define if you want to enable tracing references for debugging purpose */
|
/* Define if you want to enable tracing references for debugging purpose */
|
||||||
#undef Py_TRACE_REFS
|
#undef Py_TRACE_REFS
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue