Skip to content

Commit

Permalink
Revert "update freebsd errno patch"
Browse files Browse the repository at this point in the history
This reverts commit 79134fe.
  • Loading branch information
bjia56 committed Dec 14, 2024
1 parent f6e1a9b commit f0d59db
Show file tree
Hide file tree
Showing 10 changed files with 60 additions and 60 deletions.
30 changes: 17 additions & 13 deletions patches/3.10/02-freebsd-errno.patch
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
diff --git a/Include/Python.h b/Include/Python.h
index fb2d32d7110..5b684c7079d 100644
index 7f7ed5981c..9499df113f 100644
--- a/Include/Python.h
+++ b/Include/Python.h
@@ -34,6 +34,11 @@
// version 3.13 and newer.
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
# include <errno.h> // errno
+# if defined(__FreeBSD__)
+# ifndef EWOULDBLOCK
+# define EWOULDBLOCK EAGAIN /* Operation would block */
+# endif
+# endif
# include <stdio.h> // FILE*
# include <stdlib.h> // getenv()
# include <string.h> // memcpy()
@@ -29,7 +29,15 @@

#include <string.h>
#ifdef HAVE_ERRNO_H
+# if defined(__FreeBSD__) && defined(_POSIX_SOURCE)
+# define _WANT_POSIX_SOURCE
+# undef _POSIX_SOURCE
+# endif
#include <errno.h>
+# if defined(_WANT_POSIX_SOURCE)
+# undef _WANT_POSIX_SOURCE
+# define _POSIX_SOURCE
+# endif
#endif
#include <stdlib.h>
#ifndef MS_WINDOWS
22 changes: 13 additions & 9 deletions patches/3.11/02-freebsd-errno.patch
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
diff --git a/Include/Python.h b/Include/Python.h
index fb2d32d7110..5b684c7079d 100644
index 52a7aac6ba..c09deb9223 100644
--- a/Include/Python.h
+++ b/Include/Python.h
@@ -34,6 +34,11 @@
// version 3.13 and newer.
@@ -22,7 +22,15 @@
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
# include <stdlib.h>
# include <stdio.h> // FILE*
+# if defined(__FreeBSD__) && defined(_POSIX_SOURCE)
+# define _WANT_POSIX_SOURCE
+# undef _POSIX_SOURCE
+# endif
# include <errno.h> // errno
+# if defined(__FreeBSD__)
+# ifndef EWOULDBLOCK
+# define EWOULDBLOCK EAGAIN /* Operation would block */
+# endif
+# if defined(_WANT_POSIX_SOURCE)
+# define _POSIX_SOURCE
+# undef _WANT_POSIX_SOURCE
+# endif
# include <stdio.h> // FILE*
# include <stdlib.h> // getenv()
# include <string.h> // memcpy()
#endif
#ifndef MS_WINDOWS
22 changes: 13 additions & 9 deletions patches/3.12/02-freebsd-errno.patch
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
diff --git a/Include/Python.h b/Include/Python.h
index fb2d32d7110..5b684c7079d 100644
index 52a7aac6ba..c09deb9223 100644
--- a/Include/Python.h
+++ b/Include/Python.h
@@ -34,6 +34,11 @@
// version 3.13 and newer.
@@ -22,7 +22,15 @@
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
# include <stdlib.h>
# include <stdio.h> // FILE*
+# if defined(__FreeBSD__) && defined(_POSIX_SOURCE)
+# define _WANT_POSIX_SOURCE
+# undef _POSIX_SOURCE
+# endif
# include <errno.h> // errno
+# if defined(__FreeBSD__)
+# ifndef EWOULDBLOCK
+# define EWOULDBLOCK EAGAIN /* Operation would block */
+# endif
+# if defined(_WANT_POSIX_SOURCE)
+# define _POSIX_SOURCE
+# undef _WANT_POSIX_SOURCE
+# endif
# include <stdio.h> // FILE*
# include <stdlib.h> // getenv()
# include <string.h> // memcpy()
#endif
#ifndef MS_WINDOWS
File renamed without changes.
16 changes: 0 additions & 16 deletions patches/3.13/02-freebsd-errno.patch

This file was deleted.

File renamed without changes.
File renamed without changes.
30 changes: 17 additions & 13 deletions patches/3.9/02-freebsd-errno.patch
Original file line number Diff line number Diff line change
@@ -1,16 +1,20 @@
diff --git a/Include/Python.h b/Include/Python.h
index fb2d32d7110..5b684c7079d 100644
index 7f7ed5981c..9499df113f 100644
--- a/Include/Python.h
+++ b/Include/Python.h
@@ -34,6 +34,11 @@
// version 3.13 and newer.
#if !defined(Py_LIMITED_API) || Py_LIMITED_API+0 < 0x030b0000
# include <errno.h> // errno
+# if defined(__FreeBSD__)
+# ifndef EWOULDBLOCK
+# define EWOULDBLOCK EAGAIN /* Operation would block */
+# endif
+# endif
# include <stdio.h> // FILE*
# include <stdlib.h> // getenv()
# include <string.h> // memcpy()
@@ -29,7 +29,15 @@

#include <string.h>
#ifdef HAVE_ERRNO_H
+# if defined(__FreeBSD__) && defined(_POSIX_SOURCE)
+# define _WANT_POSIX_SOURCE
+# undef _POSIX_SOURCE
+# endif
#include <errno.h>
+# if defined(_WANT_POSIX_SOURCE)
+# undef _WANT_POSIX_SOURCE
+# define _POSIX_SOURCE
+# endif
#endif
#include <stdlib.h>
#ifndef MS_WINDOWS

0 comments on commit f0d59db

Please sign in to comment.