Skip to content

Don't define __*_ENDIAN__ macro on Unix. #495

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions msgpack/fallback.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
def dict_iteritems(d):
return d.iteritems()


else:
int_types = int
unicode = str
Expand All @@ -32,7 +31,6 @@ def _is_recursionerror(e):
and e.args[0].startswith("maximum recursion depth exceeded")
)


else:

def _is_recursionerror(e):
Expand Down Expand Up @@ -68,7 +66,6 @@ def write(self, s):
def getvalue(self):
return self.builder.build()


else:
USING_STRINGBUILDER = False
from io import BytesIO as StringIO
Expand Down Expand Up @@ -143,7 +140,6 @@ def _unpack_from(f, b, o=0):
"""Explicit type cast for legacy struct.unpack_from"""
return struct.unpack_from(f, bytes(b), o)


else:
_unpack_from = struct.unpack_from

Expand Down
6 changes: 2 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,10 @@ def __init__(self, *args, **kwargs):


libraries = []
macros = []

if sys.platform == "win32":
libraries.append("ws2_32")

if sys.byteorder == "big":
macros = [("__BIG_ENDIAN__", "1")]
else:
macros = [("__LITTLE_ENDIAN__", "1")]

ext_modules = []
Expand Down