Skip to content
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

Fixes for changed constants. #125

Merged
merged 2 commits into from
Sep 1, 2021
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
1 change: 1 addition & 0 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,4 @@ Dylan Lukes
Guglielmo Gemignani
Vince Jankovics
Tobias Grubenmann
Arvid Norlander
59 changes: 42 additions & 17 deletions pyswip/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -755,23 +755,48 @@ def check_and_call(*args):
# * CHAR BUFFERS *
# *******************************/

CVT_ATOM = 0x0001
CVT_STRING = 0x0002
CVT_LIST = 0x0004
CVT_INTEGER = 0x0008
CVT_FLOAT = 0x0010
CVT_VARIABLE = 0x0020
CVT_NUMBER = CVT_INTEGER | CVT_FLOAT
CVT_ATOMIC = CVT_NUMBER | CVT_ATOM | CVT_STRING
CVT_WRITE = 0x0040 # as of version 3.2.10
CVT_ALL = CVT_ATOMIC | CVT_LIST
CVT_MASK = 0x00ff

BUF_DISCARDABLE = 0x0000
BUF_RING = 0x0100
BUF_MALLOC = 0x0200

CVT_EXCEPTION = 0x10000 # throw exception on error
# Changed in 8.1.22
if PL_VERSION < 80122:
CVT_ATOM = 0x0001
CVT_STRING = 0x0002
CVT_LIST = 0x0004
CVT_INTEGER = 0x0008
CVT_FLOAT = 0x0010
CVT_VARIABLE = 0x0020
CVT_NUMBER = CVT_INTEGER | CVT_FLOAT
CVT_ATOMIC = CVT_NUMBER | CVT_ATOM | CVT_STRING
CVT_WRITE = 0x0040 # as of version 3.2.10
CVT_ALL = CVT_ATOMIC | CVT_LIST
CVT_MASK = 0x00ff

BUF_DISCARDABLE = 0x0000
BUF_RING = 0x0100
BUF_MALLOC = 0x0200

CVT_EXCEPTION = 0x10000 # throw exception on error
else:
CVT_ATOM = 0x00000001
CVT_STRING = 0x00000002
CVT_LIST = 0x00000004
CVT_INTEGER = 0x00000008
CVT_RATIONAL = 0x00000010
CVT_FLOAT = 0x00000020
CVT_VARIABLE = 0x00000040
CVT_NUMBER = CVT_RATIONAL | CVT_FLOAT
CVT_ATOMIC = CVT_NUMBER | CVT_ATOM | CVT_STRING
CVT_WRITE = 0x00000080
CVT_WRITE_CANONICAL = 0x00000080
CVT_WRITEQ = 0x000000C0
CVT_ALL = CVT_ATOMIC | CVT_LIST
CVT_MASK = 0x00000fff

BUF_DISCARDABLE = 0x00000000
BUF_STACK = 0x00010000
BUF_RING = BUF_STACK
BUF_MALLOC = 0x00020000
BUF_ALLOW_STACK = 0x00040000

CVT_EXCEPTION = 0x00001000 # throw exception on error



Expand Down