snowflake-connector-python 3.16.0__cp313-cp313-win_amd64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- snowflake/connector/__init__.py +96 -0
- snowflake/connector/_query_context_cache.py +276 -0
- snowflake/connector/_sql_util.py +48 -0
- snowflake/connector/_utils.py +70 -0
- snowflake/connector/arrow_context.py +203 -0
- snowflake/connector/auth/__init__.py +53 -0
- snowflake/connector/auth/_auth.py +586 -0
- snowflake/connector/auth/_http_server.py +220 -0
- snowflake/connector/auth/_oauth_base.py +400 -0
- snowflake/connector/auth/by_plugin.py +219 -0
- snowflake/connector/auth/default.py +36 -0
- snowflake/connector/auth/idtoken.py +72 -0
- snowflake/connector/auth/keypair.py +222 -0
- snowflake/connector/auth/no_auth.py +39 -0
- snowflake/connector/auth/oauth.py +49 -0
- snowflake/connector/auth/oauth_code.py +479 -0
- snowflake/connector/auth/oauth_credentials.py +66 -0
- snowflake/connector/auth/okta.py +335 -0
- snowflake/connector/auth/pat.py +39 -0
- snowflake/connector/auth/usrpwdmfa.py +69 -0
- snowflake/connector/auth/webbrowser.py +502 -0
- snowflake/connector/auth/workload_identity.py +94 -0
- snowflake/connector/azure_storage_client.py +276 -0
- snowflake/connector/backoff_policies.py +141 -0
- snowflake/connector/bind_upload_agent.py +89 -0
- snowflake/connector/cache.py +696 -0
- snowflake/connector/compat.py +127 -0
- snowflake/connector/config_manager.py +496 -0
- snowflake/connector/connection.py +2273 -0
- snowflake/connector/connection_diagnostic.py +776 -0
- snowflake/connector/constants.py +442 -0
- snowflake/connector/converter.py +785 -0
- snowflake/connector/converter_issue23517.py +87 -0
- snowflake/connector/converter_null.py +14 -0
- snowflake/connector/converter_snowsql.py +205 -0
- snowflake/connector/cursor.py +1951 -0
- snowflake/connector/dbapi.py +53 -0
- snowflake/connector/description.py +19 -0
- snowflake/connector/direct_file_operation_utils.py +88 -0
- snowflake/connector/encryption_util.py +220 -0
- snowflake/connector/errorcode.py +91 -0
- snowflake/connector/errors.py +615 -0
- snowflake/connector/externals_utils/__init__.py +0 -0
- snowflake/connector/externals_utils/externals_setup.py +27 -0
- snowflake/connector/feature.py +4 -0
- snowflake/connector/file_compression_type.py +118 -0
- snowflake/connector/file_lock.py +72 -0
- snowflake/connector/file_transfer_agent.py +1215 -0
- snowflake/connector/file_util.py +153 -0
- snowflake/connector/gcs_storage_client.py +474 -0
- snowflake/connector/gzip_decoder.py +85 -0
- snowflake/connector/local_storage_client.py +90 -0
- snowflake/connector/log_configuration.py +60 -0
- snowflake/connector/logging_utils/__init__.py +0 -0
- snowflake/connector/logging_utils/filters.py +72 -0
- snowflake/connector/nanoarrow_arrow_iterator.cp313-win_amd64.pyd +0 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/ArrayConverter.cpp +60 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/ArrayConverter.hpp +29 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/BinaryConverter.cpp +19 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/BinaryConverter.hpp +26 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/BooleanConverter.cpp +21 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/BooleanConverter.hpp +23 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/CArrowChunkIterator.cpp +557 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/CArrowChunkIterator.hpp +98 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/CArrowIterator.cpp +125 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/CArrowIterator.hpp +115 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/CArrowTableIterator.cpp +1005 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/CArrowTableIterator.hpp +127 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/DateConverter.cpp +47 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/DateConverter.hpp +46 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/DecFloatConverter.cpp +83 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/DecFloatConverter.hpp +35 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/DecimalConverter.cpp +97 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/DecimalConverter.hpp +72 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/FixedSizeListConverter.cpp +73 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/FixedSizeListConverter.hpp +28 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/FloatConverter.cpp +30 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/FloatConverter.hpp +35 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/IColumnConverter.hpp +17 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/IntConverter.cpp +23 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/IntConverter.hpp +45 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/IntervalConverter.cpp +71 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/IntervalConverter.hpp +56 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/LICENSE.txt +209 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/MapConverter.cpp +75 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/MapConverter.hpp +30 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/ObjectConverter.cpp +46 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/ObjectConverter.hpp +29 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/Python/Common.cpp +8 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/Python/Common.hpp +95 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/Python/Helpers.cpp +57 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/Python/Helpers.hpp +36 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/SnowflakeType.cpp +34 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/SnowflakeType.hpp +48 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/StringConverter.cpp +19 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/StringConverter.hpp +26 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/TimeConverter.cpp +36 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/TimeConverter.hpp +31 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/TimeStampConverter.cpp +346 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/TimeStampConverter.hpp +145 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/Util/macros.hpp +14 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/Util/time.cpp +65 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/Util/time.hpp +68 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_accessors.h +101 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_alloc.h +127 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_assert.h +45 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_builder.h +1908 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_emitter.h +215 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_endian.h +125 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_epilogue.h +7 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_flatbuffers.h +55 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_identifier.h +148 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_iov.h +31 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_prologue.h +8 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_refmap.h +144 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_rtconfig.h +162 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_types.h +97 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/flatcc_verifier.h +239 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/flatcc_portable.h +14 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/paligned_alloc.h +210 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pattributes.h +84 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pdiagnostic.h +84 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pdiagnostic_pop.h +20 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pdiagnostic_push.h +51 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pendian.h +206 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pendian_detect.h +118 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pinline.h +19 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pinttypes.h +52 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/portable.h +2 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/portable_basic.h +25 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pstatic_assert.h +67 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pstdalign.h +162 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pstdint.h +898 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/punaligned.h +190 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pversion.h +6 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc/portable/pwarnings.h +52 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/flatcc.c +3204 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow.c +3217 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow.h +3618 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow.hpp +379 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow_arrow_iterator.pyx +256 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow_device.c +512 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow_device.h +350 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow_ipc.c +33273 -0
- snowflake/connector/nanoarrow_cpp/ArrowIterator/nanoarrow_ipc.h +397 -0
- snowflake/connector/nanoarrow_cpp/Logging/logging.cpp +100 -0
- snowflake/connector/nanoarrow_cpp/Logging/logging.hpp +49 -0
- snowflake/connector/network.py +1297 -0
- snowflake/connector/ocsp_asn1crypto.py +447 -0
- snowflake/connector/ocsp_snowflake.py +1883 -0
- snowflake/connector/options.py +131 -0
- snowflake/connector/pandas_tools.py +732 -0
- snowflake/connector/proxy.py +43 -0
- snowflake/connector/py.typed +0 -0
- snowflake/connector/result_batch.py +786 -0
- snowflake/connector/result_set.py +319 -0
- snowflake/connector/s3_storage_client.py +605 -0
- snowflake/connector/secret_detector.py +181 -0
- snowflake/connector/sf_dirs.py +64 -0
- snowflake/connector/sfbinaryformat.py +35 -0
- snowflake/connector/sfdatetime.py +345 -0
- snowflake/connector/snow_logging.py +144 -0
- snowflake/connector/sqlstate.py +9 -0
- snowflake/connector/ssd_internal_keys.py +30 -0
- snowflake/connector/ssl_wrap_socket.py +134 -0
- snowflake/connector/storage_client.py +478 -0
- snowflake/connector/telemetry.py +249 -0
- snowflake/connector/telemetry_oob.py +543 -0
- snowflake/connector/test_util.py +30 -0
- snowflake/connector/time_util.py +159 -0
- snowflake/connector/token_cache.py +402 -0
- snowflake/connector/tool/__init__.py +0 -0
- snowflake/connector/tool/dump_certs.py +57 -0
- snowflake/connector/tool/dump_ocsp_response.py +139 -0
- snowflake/connector/tool/dump_ocsp_response_cache.py +194 -0
- snowflake/connector/tool/probe_connection.py +69 -0
- snowflake/connector/url_util.py +49 -0
- snowflake/connector/util_text.py +301 -0
- snowflake/connector/vendored/__init__.py +3 -0
- snowflake/connector/vendored/requests/LICENSE +175 -0
- snowflake/connector/vendored/requests/__init__.py +169 -0
- snowflake/connector/vendored/requests/__version__.py +14 -0
- snowflake/connector/vendored/requests/_internal_utils.py +50 -0
- snowflake/connector/vendored/requests/adapters.py +537 -0
- snowflake/connector/vendored/requests/api.py +157 -0
- snowflake/connector/vendored/requests/auth.py +315 -0
- snowflake/connector/vendored/requests/certs.py +17 -0
- snowflake/connector/vendored/requests/compat.py +79 -0
- snowflake/connector/vendored/requests/cookies.py +561 -0
- snowflake/connector/vendored/requests/exceptions.py +140 -0
- snowflake/connector/vendored/requests/help.py +134 -0
- snowflake/connector/vendored/requests/hooks.py +33 -0
- snowflake/connector/vendored/requests/models.py +1033 -0
- snowflake/connector/vendored/requests/sessions.py +833 -0
- snowflake/connector/vendored/requests/status_codes.py +128 -0
- snowflake/connector/vendored/requests/structures.py +99 -0
- snowflake/connector/vendored/requests/utils.py +1093 -0
- snowflake/connector/vendored/urllib3/LICENSE.txt +21 -0
- snowflake/connector/vendored/urllib3/__init__.py +85 -0
- snowflake/connector/vendored/urllib3/_collections.py +355 -0
- snowflake/connector/vendored/urllib3/_version.py +2 -0
- snowflake/connector/vendored/urllib3/connection.py +572 -0
- snowflake/connector/vendored/urllib3/connectionpool.py +1137 -0
- snowflake/connector/vendored/urllib3/contrib/__init__.py +0 -0
- snowflake/connector/vendored/urllib3/contrib/_appengine_environ.py +36 -0
- snowflake/connector/vendored/urllib3/contrib/_securetransport/__init__.py +0 -0
- snowflake/connector/vendored/urllib3/contrib/_securetransport/bindings.py +519 -0
- snowflake/connector/vendored/urllib3/contrib/_securetransport/low_level.py +397 -0
- snowflake/connector/vendored/urllib3/contrib/appengine.py +314 -0
- snowflake/connector/vendored/urllib3/contrib/ntlmpool.py +130 -0
- snowflake/connector/vendored/urllib3/contrib/pyopenssl.py +509 -0
- snowflake/connector/vendored/urllib3/contrib/securetransport.py +920 -0
- snowflake/connector/vendored/urllib3/contrib/socks.py +216 -0
- snowflake/connector/vendored/urllib3/exceptions.py +323 -0
- snowflake/connector/vendored/urllib3/fields.py +274 -0
- snowflake/connector/vendored/urllib3/filepost.py +98 -0
- snowflake/connector/vendored/urllib3/packages/__init__.py +0 -0
- snowflake/connector/vendored/urllib3/packages/backports/__init__.py +0 -0
- snowflake/connector/vendored/urllib3/packages/backports/makefile.py +51 -0
- snowflake/connector/vendored/urllib3/packages/backports/weakref_finalize.py +155 -0
- snowflake/connector/vendored/urllib3/packages/six.py +1076 -0
- snowflake/connector/vendored/urllib3/poolmanager.py +540 -0
- snowflake/connector/vendored/urllib3/request.py +191 -0
- snowflake/connector/vendored/urllib3/response.py +885 -0
- snowflake/connector/vendored/urllib3/util/__init__.py +49 -0
- snowflake/connector/vendored/urllib3/util/connection.py +156 -0
- snowflake/connector/vendored/urllib3/util/proxy.py +57 -0
- snowflake/connector/vendored/urllib3/util/queue.py +22 -0
- snowflake/connector/vendored/urllib3/util/request.py +146 -0
- snowflake/connector/vendored/urllib3/util/response.py +107 -0
- snowflake/connector/vendored/urllib3/util/retry.py +620 -0
- snowflake/connector/vendored/urllib3/util/ssl_.py +495 -0
- snowflake/connector/vendored/urllib3/util/ssl_match_hostname.py +159 -0
- snowflake/connector/vendored/urllib3/util/ssltransport.py +221 -0
- snowflake/connector/vendored/urllib3/util/timeout.py +271 -0
- snowflake/connector/vendored/urllib3/util/url.py +435 -0
- snowflake/connector/vendored/urllib3/util/wait.py +152 -0
- snowflake/connector/version.py +3 -0
- snowflake/connector/wif_util.py +407 -0
- snowflake_connector_python-3.16.0.dist-info/METADATA +1475 -0
- snowflake_connector_python-3.16.0.dist-info/RECORD +246 -0
- snowflake_connector_python-3.16.0.dist-info/WHEEL +5 -0
- snowflake_connector_python-3.16.0.dist-info/entry_points.txt +4 -0
- snowflake_connector_python-3.16.0.dist-info/licenses/LICENSE.txt +202 -0
- snowflake_connector_python-3.16.0.dist-info/licenses/NOTICE +8 -0
- snowflake_connector_python-3.16.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Uses various known flags to decide endianness and defines:
|
|
3
|
+
*
|
|
4
|
+
* __LITTLE_ENDIAN__ or __BIG_ENDIAN__ if not already defined
|
|
5
|
+
*
|
|
6
|
+
* and also defines
|
|
7
|
+
*
|
|
8
|
+
* __BYTE_ORDER__ to either __ORDER_LITTLE_ENDIAN__ or
|
|
9
|
+
* __ORDER_BIG_ENDIAN__ if not already defined
|
|
10
|
+
*
|
|
11
|
+
* If none of these could be set, __UNKNOWN_ENDIAN__ is defined,
|
|
12
|
+
* which is not a known flag. If __BYTE_ORDER__ is defined but
|
|
13
|
+
* not big or little endian, __UNKNOWN_ENDIAN__ is also defined.
|
|
14
|
+
*
|
|
15
|
+
* Note: Some systems define __BYTE_ORDER without __ at the end
|
|
16
|
+
* - this will be mapped to to __BYTE_ORDER__.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
#ifndef PENDIAN_DETECT
|
|
20
|
+
#define PENDIAN_DETECT
|
|
21
|
+
|
|
22
|
+
#ifdef __cplusplus
|
|
23
|
+
extern "C" {
|
|
24
|
+
#endif
|
|
25
|
+
|
|
26
|
+
#ifndef __ORDER_LITTLE_ENDIAN__
|
|
27
|
+
#define __ORDER_LITTLE_ENDIAN__ 1234
|
|
28
|
+
#endif
|
|
29
|
+
|
|
30
|
+
#ifndef __ORDER_BIG_ENDIAN__
|
|
31
|
+
#define __ORDER_BIG_ENDIAN__ 4321
|
|
32
|
+
#endif
|
|
33
|
+
|
|
34
|
+
#ifdef __BYTE_ORDER__
|
|
35
|
+
|
|
36
|
+
#if defined(__LITTLE_ENDIAN__) && __BYTE_ORDER__ != __ORDER_LITTLE_ENDIAN__
|
|
37
|
+
#error __LITTLE_ENDIAN__ inconsistent with __BYTE_ORDER__
|
|
38
|
+
#endif
|
|
39
|
+
|
|
40
|
+
#if defined(__BIG_ENDIAN__) && __BYTE_ORDER__ != __ORDER_BIG_ENDIAN__
|
|
41
|
+
#error __BIG_ENDIAN__ inconsistent with __BYTE_ORDER__
|
|
42
|
+
#endif
|
|
43
|
+
|
|
44
|
+
#else /* __BYTE_ORDER__ */
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
#if \
|
|
48
|
+
defined(__LITTLE_ENDIAN__) || \
|
|
49
|
+
(defined(__BYTE_ORDER) && __BYTE_ORDER == __ORDER_LITTLE_ENDIAN) || \
|
|
50
|
+
defined(__ARMEL__) || defined(__THUMBEL__) || \
|
|
51
|
+
defined(__AARCH64EL__) || \
|
|
52
|
+
(defined(_MSC_VER) && defined(_M_ARM)) || \
|
|
53
|
+
defined(_MIPSEL) || defined(__MIPSEL) || defined(__MIPSEL__) || \
|
|
54
|
+
defined(_M_X64) || defined(_M_IX86) || defined(_M_I86) || \
|
|
55
|
+
defined(__i386__) || defined(__alpha__) || \
|
|
56
|
+
defined(__ia64) || defined(__ia64__) || \
|
|
57
|
+
defined(_M_IA64) || defined(_M_ALPHA) || \
|
|
58
|
+
defined(__amd64) || defined(__amd64__) || defined(_M_AMD64) || \
|
|
59
|
+
defined(__x86_64) || defined(__x86_64__) || defined(_M_X64) || \
|
|
60
|
+
defined(__bfin__)
|
|
61
|
+
|
|
62
|
+
#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
|
|
63
|
+
|
|
64
|
+
#endif
|
|
65
|
+
|
|
66
|
+
#if \
|
|
67
|
+
defined (__BIG_ENDIAN__) || \
|
|
68
|
+
(defined(__BYTE_ORDER) && __BYTE_ORDER == __ORDER_BIG_ENDIAN) || \
|
|
69
|
+
defined(__ARMEB__) || defined(THUMBEB__) || defined (__AARCH64EB__) || \
|
|
70
|
+
defined(_MIPSEB) || defined(__MIPSEB) || defined(__MIPSEB__) || \
|
|
71
|
+
defined(__sparc) || defined(__sparc__) || \
|
|
72
|
+
defined(_POWER) || defined(__powerpc__) || defined(__ppc__) || \
|
|
73
|
+
defined(__hpux) || defined(__hppa) || defined(__s390__)
|
|
74
|
+
|
|
75
|
+
#define __BYTE_ORDER__ __ORDER_BIG_ENDIAN__
|
|
76
|
+
|
|
77
|
+
#endif
|
|
78
|
+
|
|
79
|
+
#endif /* __BYTE_ORDER__ */
|
|
80
|
+
|
|
81
|
+
#ifdef __BYTE_ORDER__
|
|
82
|
+
|
|
83
|
+
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
|
84
|
+
|
|
85
|
+
#ifndef __LITTLE_ENDIAN__
|
|
86
|
+
#define __LITTLE_ENDIAN__ 1
|
|
87
|
+
#endif
|
|
88
|
+
|
|
89
|
+
#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
|
|
90
|
+
|
|
91
|
+
#ifndef __BIG_ENDIAN__
|
|
92
|
+
#define __BIG_ENDIAN__ 1
|
|
93
|
+
#endif
|
|
94
|
+
|
|
95
|
+
#else
|
|
96
|
+
|
|
97
|
+
/*
|
|
98
|
+
* Custom extension - we only define __BYTE_ORDER__ if known big or little.
|
|
99
|
+
* User code that understands __BYTE_ORDER__ may also assume unkown if
|
|
100
|
+
* it is not defined by now - this will allow other endian formats than
|
|
101
|
+
* big or little when supported by compiler.
|
|
102
|
+
*/
|
|
103
|
+
#ifndef __UNKNOWN_ENDIAN__
|
|
104
|
+
#define __UNKNOWN_ENDIAN__ 1
|
|
105
|
+
#endif
|
|
106
|
+
|
|
107
|
+
#endif
|
|
108
|
+
#endif /* __BYTE_ORDER__ */
|
|
109
|
+
|
|
110
|
+
#if defined(__LITTLE_ENDIAN__) && defined(__BIG_ENDIAN__)
|
|
111
|
+
#error conflicting definitions of __LITTLE_ENDIAN__ and __BIG_ENDIAN__
|
|
112
|
+
#endif
|
|
113
|
+
|
|
114
|
+
#ifdef __cplusplus
|
|
115
|
+
}
|
|
116
|
+
#endif
|
|
117
|
+
|
|
118
|
+
#endif /* PENDIAN_DETECT */
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
#ifndef PINLINE_H
|
|
2
|
+
#define PINLINE_H
|
|
3
|
+
|
|
4
|
+
#ifndef __cplusplus
|
|
5
|
+
|
|
6
|
+
#if (defined(__STDC__) && __STDC__ && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
|
|
7
|
+
/* C99 or newer */
|
|
8
|
+
#elif _MSC_VER >= 1500 /* MSVC 9 or newer */
|
|
9
|
+
#undef inline
|
|
10
|
+
#define inline __inline
|
|
11
|
+
#elif __GNUC__ >= 3 /* GCC 3 or newer */
|
|
12
|
+
#define inline __inline
|
|
13
|
+
#else /* Unknown or ancient */
|
|
14
|
+
#define inline
|
|
15
|
+
#endif
|
|
16
|
+
|
|
17
|
+
#endif /* __cplusplus */
|
|
18
|
+
|
|
19
|
+
#endif /* PINLINE_H */
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
#ifndef PINTTYPES_H
|
|
2
|
+
#define PINTTYPES_H
|
|
3
|
+
|
|
4
|
+
#ifndef PRId16
|
|
5
|
+
|
|
6
|
+
#if (defined(__STDC__) && __STDC__ && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
|
|
7
|
+
/* C99 or newer */
|
|
8
|
+
#include <inttypes.h>
|
|
9
|
+
#else
|
|
10
|
+
|
|
11
|
+
/*
|
|
12
|
+
* This is not a complete implementation of <inttypes.h>, just the most
|
|
13
|
+
* useful printf modifiers.
|
|
14
|
+
*/
|
|
15
|
+
|
|
16
|
+
#include "pstdint.h"
|
|
17
|
+
|
|
18
|
+
#ifndef PRINTF_INT64_MODIFIER
|
|
19
|
+
#error "please define PRINTF_INT64_MODIFIER"
|
|
20
|
+
#endif
|
|
21
|
+
|
|
22
|
+
#ifndef PRId64
|
|
23
|
+
#define PRId64 PRINTF_INT64_MODIFIER "d"
|
|
24
|
+
#define PRIu64 PRINTF_INT64_MODIFIER "u"
|
|
25
|
+
#define PRIx64 PRINTF_INT64_MODIFIER "x"
|
|
26
|
+
#endif
|
|
27
|
+
|
|
28
|
+
#ifndef PRINTF_INT32_MODIFIER
|
|
29
|
+
#define PRINTF_INT32_MODIFIER "l"
|
|
30
|
+
#endif
|
|
31
|
+
|
|
32
|
+
#ifndef PRId32
|
|
33
|
+
#define PRId32 PRINTF_INT32_MODIFIER "d"
|
|
34
|
+
#define PRIu32 PRINTF_INT32_MODIFIER "u"
|
|
35
|
+
#define PRIx32 PRINTF_INT32_MODIFIER "x"
|
|
36
|
+
#endif
|
|
37
|
+
|
|
38
|
+
#ifndef PRINTF_INT16_MODIFIER
|
|
39
|
+
#define PRINTF_INT16_MODIFIER "h"
|
|
40
|
+
#endif
|
|
41
|
+
|
|
42
|
+
#ifndef PRId16
|
|
43
|
+
#define PRId16 PRINTF_INT16_MODIFIER "d"
|
|
44
|
+
#define PRIu16 PRINTF_INT16_MODIFIER "u"
|
|
45
|
+
#define PRIx16 PRINTF_INT16_MODIFIER "x"
|
|
46
|
+
#endif
|
|
47
|
+
|
|
48
|
+
# endif /* __STDC__ */
|
|
49
|
+
|
|
50
|
+
#endif /* PRId16 */
|
|
51
|
+
|
|
52
|
+
#endif /* PINTTYPES */
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#ifndef PORTABLE_BASIC_H
|
|
2
|
+
#define PORTABLE_BASIC_H
|
|
3
|
+
|
|
4
|
+
/*
|
|
5
|
+
* Basic features need to make compilers support the most common moden C
|
|
6
|
+
* features, and endian / unligned read support as well.
|
|
7
|
+
*
|
|
8
|
+
* It is not assumed that this file is always included.
|
|
9
|
+
* Other include files are independent or include what they need.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
#include "pversion.h"
|
|
13
|
+
#include "pwarnings.h"
|
|
14
|
+
|
|
15
|
+
/* Featutures that ought to be supported by C11, but some aren't. */
|
|
16
|
+
#include "pinttypes.h"
|
|
17
|
+
#include "pstdalign.h"
|
|
18
|
+
#include "pinline.h"
|
|
19
|
+
#include "pstatic_assert.h"
|
|
20
|
+
|
|
21
|
+
/* These are not supported by C11 and are general platform abstractions. */
|
|
22
|
+
#include "pendian.h"
|
|
23
|
+
#include "punaligned.h"
|
|
24
|
+
|
|
25
|
+
#endif /* PORTABLE_BASIC_H */
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
#ifndef PSTATIC_ASSERT_H
|
|
2
|
+
#define PSTATIC_ASSERT_H
|
|
3
|
+
|
|
4
|
+
#include <assert.h>
|
|
5
|
+
|
|
6
|
+
/* Handle clang */
|
|
7
|
+
#ifndef __has_feature
|
|
8
|
+
#define __has_feature(x) 0
|
|
9
|
+
#endif
|
|
10
|
+
|
|
11
|
+
#if defined(static_assert)
|
|
12
|
+
#ifndef __static_assert_is_defined
|
|
13
|
+
#define __static_assert_is_defined 1
|
|
14
|
+
#endif
|
|
15
|
+
#endif
|
|
16
|
+
|
|
17
|
+
/* Handle static_assert as a keyword in C++ and compiler specifics. */
|
|
18
|
+
#if !defined(__static_assert_is_defined)
|
|
19
|
+
|
|
20
|
+
#if defined(__cplusplus)
|
|
21
|
+
|
|
22
|
+
#if __cplusplus >= 201103L
|
|
23
|
+
#define __static_assert_is_defined 1
|
|
24
|
+
#elif __has_feature(cxx_static_assert)
|
|
25
|
+
#define __static_assert_is_defined 1
|
|
26
|
+
#elif defined(_MSC_VER) && (_MSC_VER >= 1600)
|
|
27
|
+
#define __static_assert_is_defined 1
|
|
28
|
+
#endif
|
|
29
|
+
|
|
30
|
+
#else
|
|
31
|
+
|
|
32
|
+
#if defined(_MSC_VER) && (_MSC_VER >= 1600)
|
|
33
|
+
#define __static_assert_is_defined 1
|
|
34
|
+
#elif __has_feature(c_static_assert)
|
|
35
|
+
#define static_assert(pred, msg) _Static_assert(pred, msg)
|
|
36
|
+
#define __static_assert_is_defined 1
|
|
37
|
+
#elif defined (__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
|
|
38
|
+
/* In case the clib headers are not compliant. */
|
|
39
|
+
#define static_assert(pred, msg) _Static_assert(pred, msg)
|
|
40
|
+
#define __static_assert_is_defined 1
|
|
41
|
+
#endif
|
|
42
|
+
|
|
43
|
+
#endif /* __cplusplus */
|
|
44
|
+
#endif /* __static_assert_is_defined */
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
#if !defined(__static_assert_is_defined)
|
|
48
|
+
|
|
49
|
+
#define __PSTATIC_ASSERT_CONCAT_(a, b) static_assert_scope_##a##_line_##b
|
|
50
|
+
#define __PSTATIC_ASSERT_CONCAT(a, b) __PSTATIC_ASSERT_CONCAT_(a, b)
|
|
51
|
+
#ifdef __COUNTER__
|
|
52
|
+
#define static_assert(e, msg) enum { __PSTATIC_ASSERT_CONCAT(__COUNTER__, __LINE__) = 1/(!!(e)) }
|
|
53
|
+
#else
|
|
54
|
+
#include "pstatic_assert_scope.h"
|
|
55
|
+
#define static_assert(e, msg) enum { __PSTATIC_ASSERT_CONCAT(__PSTATIC_ASSERT_COUNTER, __LINE__) = 1/(int)(!!(e)) }
|
|
56
|
+
#endif
|
|
57
|
+
|
|
58
|
+
#define __static_assert_is_defined 1
|
|
59
|
+
|
|
60
|
+
#endif /* __static_assert_is_defined */
|
|
61
|
+
|
|
62
|
+
#endif /* PSTATIC_ASSERT_H */
|
|
63
|
+
|
|
64
|
+
/* Update scope counter outside of include guard. */
|
|
65
|
+
#ifdef __PSTATIC_ASSERT_COUNTER
|
|
66
|
+
#include "pstatic_assert_scope.h"
|
|
67
|
+
#endif
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
#ifndef PSTDALIGN_H
|
|
2
|
+
#define PSTDALIGN_H
|
|
3
|
+
|
|
4
|
+
/*
|
|
5
|
+
* NOTE: aligned_alloc is defined via paligned_alloc.h
|
|
6
|
+
* and requires aligned_free to be fully portable although
|
|
7
|
+
* free also works on C11 and platforms with posix_memalign.
|
|
8
|
+
*
|
|
9
|
+
* NOTE: C++11 defines alignas as a keyword but then also defines
|
|
10
|
+
* __alignas_is_defined.
|
|
11
|
+
*
|
|
12
|
+
* C++14 does not define __alignas_is_defined, at least sometimes.
|
|
13
|
+
*
|
|
14
|
+
* GCC 8.3 reverts on this and makes C++11 behave the same as C++14
|
|
15
|
+
* preventing a simple __cplusplus version check from working.
|
|
16
|
+
*
|
|
17
|
+
* Clang C++ without std=c++11 or std=c++14 does define alignas
|
|
18
|
+
* but does so incorrectly wrt. C11 and C++11 semantics because
|
|
19
|
+
* `alignas(4) float x;` is not recognized.
|
|
20
|
+
* To fix such issues, either move to a std version, or
|
|
21
|
+
* include a working stdalign.h for the given compiler before
|
|
22
|
+
* this file.
|
|
23
|
+
*
|
|
24
|
+
* newlib defines _Alignas and _Alignof in sys/cdefs but rely on
|
|
25
|
+
* gcc version for <stdaligh.h> which can lead to conflicts if
|
|
26
|
+
* stdalign is not included.
|
|
27
|
+
*
|
|
28
|
+
* newlibs need for <stdalign.h> conflicts with broken C++ stdalign
|
|
29
|
+
* but this can be fixed be using std=C++11 or newer.
|
|
30
|
+
*
|
|
31
|
+
* MSVC does not support <stdalign.h> at least up to MSVC 2015,
|
|
32
|
+
* but does appear to support alignas and alignof keywords in
|
|
33
|
+
* recent standard C++.
|
|
34
|
+
*
|
|
35
|
+
* TCC only supports alignas with a numeric argument like
|
|
36
|
+
* `alignas(4)`, but not `alignas(float)`.
|
|
37
|
+
*
|
|
38
|
+
* If stdalign.h is supported but heuristics in this file are
|
|
39
|
+
* insufficient to detect this, try including <stdaligh.h> manually
|
|
40
|
+
* or define HAVE_STDALIGN_H.
|
|
41
|
+
*/
|
|
42
|
+
|
|
43
|
+
/* https://github.com/dvidelabs/flatcc/issues/130 */
|
|
44
|
+
#ifndef __alignas_is_defined
|
|
45
|
+
#if defined(__cplusplus)
|
|
46
|
+
#if __cplusplus == 201103 && !defined(__clang__) && ((__GNUC__ > 8) || (__GNUC__ == 8 && __GNUC_MINOR__ >= 3))
|
|
47
|
+
#define __alignas_is_defined 1
|
|
48
|
+
#define __alignof_is_defined 1
|
|
49
|
+
#include <stdalign.h>
|
|
50
|
+
#endif
|
|
51
|
+
#endif
|
|
52
|
+
#endif
|
|
53
|
+
|
|
54
|
+
/* Allow for alternative solution to be included first. */
|
|
55
|
+
#ifndef __alignas_is_defined
|
|
56
|
+
|
|
57
|
+
#ifdef __cplusplus
|
|
58
|
+
#if defined(PORTABLE_PATCH_CPLUSPLUS_STDALIGN)
|
|
59
|
+
#include <stdalign.h>
|
|
60
|
+
#undef alignas
|
|
61
|
+
#define alignas(t) __attribute__((__aligned__(t)))
|
|
62
|
+
#endif
|
|
63
|
+
#endif
|
|
64
|
+
|
|
65
|
+
#if !defined(PORTABLE_HAS_INCLUDE_STDALIGN)
|
|
66
|
+
#if defined(__has_include)
|
|
67
|
+
#if __has_include(<stdalign.h>)
|
|
68
|
+
#define PORTABLE_HAS_INCLUDE_STDALIGN 1
|
|
69
|
+
#else
|
|
70
|
+
#define PORTABLE_HAS_INCLUDE_STDALIGN 0
|
|
71
|
+
#endif
|
|
72
|
+
#endif
|
|
73
|
+
#endif
|
|
74
|
+
|
|
75
|
+
/* https://lists.gnu.org/archive/html/bug-gnulib/2015-08/msg00003.html */
|
|
76
|
+
#if defined(__cplusplus)
|
|
77
|
+
#if !defined(_MSC_VER)
|
|
78
|
+
#include <stdalign.h>
|
|
79
|
+
#endif
|
|
80
|
+
#if __cplusplus > 201103
|
|
81
|
+
#define __alignas_is_defined 1
|
|
82
|
+
#define __alignof_is_defined 1
|
|
83
|
+
#endif
|
|
84
|
+
#elif PORTABLE_HAS_INCLUDE_STDALIGN
|
|
85
|
+
#include <stdalign.h>
|
|
86
|
+
#elif !defined(__clang__) && ((__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))
|
|
87
|
+
#include <stdalign.h>
|
|
88
|
+
#elif defined(HAVE_STDALIGN_H)
|
|
89
|
+
#include <stdaligh.h>
|
|
90
|
+
#endif
|
|
91
|
+
|
|
92
|
+
#endif /* __alignas_is_defined */
|
|
93
|
+
|
|
94
|
+
#ifndef __alignas_is_defined
|
|
95
|
+
|
|
96
|
+
#ifdef __cplusplus
|
|
97
|
+
extern "C" {
|
|
98
|
+
#endif
|
|
99
|
+
|
|
100
|
+
#if (!defined(__clang__) && defined(__GNUC__) && \
|
|
101
|
+
((__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 7)))
|
|
102
|
+
#undef PORTABLE_C11_STDALIGN_MISSING
|
|
103
|
+
#define PORTABLE_C11_STDALIGN_MISSING
|
|
104
|
+
#endif
|
|
105
|
+
|
|
106
|
+
#if defined(__IBMC__)
|
|
107
|
+
#undef PORTABLE_C11_STDALIGN_MISSING
|
|
108
|
+
#define PORTABLE_C11_STDALIGN_MISSING
|
|
109
|
+
#endif
|
|
110
|
+
|
|
111
|
+
#if ((defined(__STDC__) && __STDC__ && defined(__STDC_VERSION__) && __STDC_VERSION__ >= 201112L) && \
|
|
112
|
+
!defined(PORTABLE_C11_STDALIGN_MISSING))
|
|
113
|
+
/* C11 or newer */
|
|
114
|
+
#include <stdalign.h>
|
|
115
|
+
#else
|
|
116
|
+
#if defined(__GNUC__) || defined(__IBM_ALIGNOF__) || defined(__clang__)
|
|
117
|
+
|
|
118
|
+
#ifndef _Alignas
|
|
119
|
+
#define _Alignas(t) __attribute__((__aligned__(t)))
|
|
120
|
+
#endif
|
|
121
|
+
|
|
122
|
+
#ifndef _Alignof
|
|
123
|
+
#define _Alignof(t) __alignof__(t)
|
|
124
|
+
#endif
|
|
125
|
+
|
|
126
|
+
#elif defined(_MSC_VER)
|
|
127
|
+
|
|
128
|
+
#define _Alignas(t) __declspec (align(t))
|
|
129
|
+
#define _Alignof(t) __alignof(t)
|
|
130
|
+
|
|
131
|
+
#elif defined(__TINYC__)
|
|
132
|
+
|
|
133
|
+
/* Supports `_Alignas(integer-expression)`, but not `_Alignas(type)`. */
|
|
134
|
+
#define _Alignas(t) __attribute__(aligned(t))
|
|
135
|
+
#define _Alignof(t) __alignof__(t)
|
|
136
|
+
|
|
137
|
+
#else
|
|
138
|
+
#error please update pstdalign.h with support for current compiler and library
|
|
139
|
+
#endif
|
|
140
|
+
|
|
141
|
+
#endif /* __STDC__ */
|
|
142
|
+
|
|
143
|
+
#ifndef alignas
|
|
144
|
+
#define alignas _Alignas
|
|
145
|
+
#endif
|
|
146
|
+
|
|
147
|
+
#ifndef alignof
|
|
148
|
+
#define alignof _Alignof
|
|
149
|
+
#endif
|
|
150
|
+
|
|
151
|
+
#define __alignas_is_defined 1
|
|
152
|
+
#define __alignof_is_defined 1
|
|
153
|
+
|
|
154
|
+
#ifdef __cplusplus
|
|
155
|
+
}
|
|
156
|
+
#endif
|
|
157
|
+
|
|
158
|
+
#endif /* __alignas__is_defined */
|
|
159
|
+
|
|
160
|
+
#include "paligned_alloc.h"
|
|
161
|
+
|
|
162
|
+
#endif /* PSTDALIGN_H */
|