diff --git a/examples/knx-linux/CMakeLists.txt b/examples/knx-linux/CMakeLists.txt new file mode 100644 index 0000000..fe87d43 --- /dev/null +++ b/examples/knx-linux/CMakeLists.txt @@ -0,0 +1,123 @@ +cmake_minimum_required(VERSION 2.7) +project(knx-linux) +set(LIBRARIES_FROM_REFERENCES "") +add_executable(knx-linux + ../../src/knx/address_table_object.cpp + ../../src/knx/address_table_object.h + ../../src/knx/aes.c + ../../src/knx/aes.h + ../../src/knx/aes.hpp + ../../src/knx/apdu.cpp + ../../src/knx/apdu.h + ../../src/knx/application_layer.cpp + ../../src/knx/application_layer.h + ../../src/knx/application_program_object.cpp + ../../src/knx/application_program_object.h + ../../src/knx/association_table_object.cpp + ../../src/knx/association_table_object.h + ../../src/knx/bau.cpp + ../../src/knx/bau.h + ../../src/knx/bau07B0.cpp + ../../src/knx/bau07B0.h + ../../src/knx/bau27B0.cpp + ../../src/knx/bau27B0.h + ../../src/knx/bau57B0.cpp + ../../src/knx/bau57B0.h + ../../src/knx/bau_systemB.cpp + ../../src/knx/bau_systemB.h + ../../src/knx/bits.cpp + ../../src/knx/bits.h + ../../src/knx/callback_property.h + ../../src/knx/cemi_frame.cpp + ../../src/knx/cemi_frame.h + ../../src/knx/cemi_server.cpp + ../../src/knx/cemi_server.h + ../../src/knx/cemi_server_object.cpp + ../../src/knx/cemi_server_object.h + ../../src/knx/config.h + ../../src/knx/data_link_layer.cpp + ../../src/knx/data_link_layer.h + ../../src/knx/data_property.cpp + ../../src/knx/data_property.h + ../../src/knx/device_object.cpp + ../../src/knx/device_object.h + ../../src/knx/dpt.cpp + ../../src/knx/dpt.h + ../../src/knx/dptconvert.cpp + ../../src/knx/dptconvert.h + ../../src/knx/function_property.h + ../../src/knx/group_object.cpp + ../../src/knx/group_object.h + ../../src/knx/group_object_table_object.cpp + ../../src/knx/group_object_table_object.h + ../../src/knx/interface_object.cpp + ../../src/knx/interface_object.h + ../../src/knx/ip_data_link_layer.cpp + ../../src/knx/ip_data_link_layer.h + ../../src/knx/ip_parameter_object.cpp + ../../src/knx/ip_parameter_object.h + ../../src/knx/knx_ip_device_information_dib.cpp + ../../src/knx/knx_ip_device_information_dib.h + ../../src/knx/knx_ip_dib.cpp + ../../src/knx/knx_ip_dib.h + ../../src/knx/knx_ip_frame.cpp + ../../src/knx/knx_ip_frame.h + ../../src/knx/knx_ip_routing_indication.cpp + ../../src/knx/knx_ip_routing_indication.h + ../../src/knx/knx_ip_search_request.cpp + ../../src/knx/knx_ip_search_request.h + ../../src/knx/knx_ip_search_response.cpp + ../../src/knx/knx_ip_search_response.h + ../../src/knx/knx_ip_supported_service_dib.cpp + ../../src/knx/knx_ip_supported_service_dib.h + ../../src/knx/ip_host_protocol_address_information.cpp + ../../src/knx/ip_host_protocol_address_information.h + ../../src/knx/knx_types.h + ../../src/knx/knx_value.cpp + ../../src/knx/knx_value.h + ../../src/knx/memory.cpp + ../../src/knx/memory.h + ../../src/knx/network_layer.cpp + ../../src/knx/network_layer.h + ../../src/knx/npdu.cpp + ../../src/knx/npdu.h + ../../src/knx/platform.cpp + ../../src/knx/platform.h + ../../src/knx/property.cpp + ../../src/knx/property.h + ../../src/knx/rf_data_link_layer.cpp + ../../src/knx/rf_data_link_layer.h + ../../src/knx/rf_medium_object.cpp + ../../src/knx/rf_medium_object.h + ../../src/knx/rf_physical_layer.cpp + ../../src/knx/rf_physical_layer.h + ../../src/knx/secure_application_layer.cpp + ../../src/knx/secure_application_layer.h + ../../src/knx/security_interface_object.cpp + ../../src/knx/security_interface_object.h + ../../src/knx/simple_map.h + ../../src/knx/table_object.cpp + ../../src/knx/save_restore.h + ../../src/knx/table_object.cpp + ../../src/knx/table_object.h + ../../src/knx/tpdu.cpp + ../../src/knx/tpdu.h + ../../src/knx/tpuart_data_link_layer.cpp + ../../src/knx/tpuart_data_link_layer.h + ../../src/knx/transport_layer.cpp + ../../src/knx/transport_layer.h + ../../src/knx/usb_tunnel_interface.cpp + ../../src/knx/usb_tunnel_interface.h + ../../src/knx_facade.cpp + ../../src/knx_facade.h + ../../src/linux_platform.cpp + ../../src/linux_platform.h + fdsk.cpp + fdsk.h + main.cpp) +target_link_libraries(knx-linux "${LIBRARIES_FROM_REFERENCES}") +include_directories(../../src) +set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -Wall -Wno-unknown-pragmas -g -O0") +set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wno-unknown-pragmas -g -O0") +set_property(TARGET knx-linux PROPERTY CXX_STANDARD 11) +add_definitions(-DMEDIUM_TYPE=5) diff --git a/examples/knx-linux/CMakeSettings.json b/examples/knx-linux/CMakeSettings.json new file mode 100644 index 0000000..22985a0 --- /dev/null +++ b/examples/knx-linux/CMakeSettings.json @@ -0,0 +1,19 @@ +{ + "configurations": [ + { + "name": "WSL-Debug", + "generator": "Unix Makefiles", + "configurationType": "Debug", + "buildRoot": "${projectDir}\\out\\build\\${name}", + "installRoot": "${projectDir}\\out\\install\\${name}", + "cmakeExecutable": "/usr/bin/cmake", + "cmakeCommandArgs": "", + "buildCommandArgs": "", + "ctestCommandArgs": "", + "inheritEnvironments": [ "linux_x64" ], + "wslPath": "${defaultWSLPath}", + "addressSanitizerRuntimeFlags": "detect_leaks=0", + "variables": [] + } + ] +} \ No newline at end of file diff --git a/examples/knx-linux/fdsk.cpp b/examples/knx-linux/fdsk.cpp new file mode 100644 index 0000000..8d9b28c --- /dev/null +++ b/examples/knx-linux/fdsk.cpp @@ -0,0 +1,196 @@ +#include "fdsk.h" + +#include + +// CRC-4 generator polynom: 10011 (x^4+x+1) +const uint8_t FdskCalculator::crc4_tab[16] = +{ + 0x0, 0x3, 0x6, 0x5, 0xc, 0xf, 0xa, 0x9, + 0xb, 0x8, 0xd, 0xe, 0x7, 0x4, 0x1, 0x2 +}; + +int FdskCalculator::snprintFdsk(char* str, int strSize, uint8_t* serialNumber, uint8_t* key) +{ + char* tmpStr = generateFdskString(serialNumber, key); + int written = 0; + + for (int i = 0; i < 36; i++) + { + if (((i % 6) == 0) && (i!=0)) + { + *(str+written++) = '-'; + if (written >= strSize-1) + break; + } + *(str+written++) = tmpStr[i]; + if (written >= strSize-1) + break; + } + + *(str+written++) = '\0'; + + delete[] tmpStr; + + return written; +} + +char* FdskCalculator::generateFdskString(uint8_t* serialNumber, uint8_t* key) +{ + uint8_t buffer[6 + 16 + 1]; // 6 bytes serialnumber + 16 bytes key + 1 byte placeholder for crc-4 + memcpy(&buffer[0], serialNumber, 6); + memcpy(&buffer[6], key, 16); + buffer[22] = (crc4Array(buffer, sizeof(buffer)-1)<<4) &0xFF; + + uint8_t* outEncoded = nullptr; + toBase32(buffer, sizeof(buffer), outEncoded, false); + + return (char*)outEncoded; +} + +int FdskCalculator::ceil(float num) +{ + int inum = (int)num; + if (num == (float)inum) { + return inum; + } + return inum + 1; +} + +int FdskCalculator::toBase32(uint8_t* in, long length, uint8_t*& out, bool usePadding) +{ + char base32StandardAlphabet[] = {"ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"}; + char standardPaddingChar = '='; + + int result = 0; + int count = 0; + int bufSize = 8; + int index = 0; + int size = 0; // size of temporary array + uint8_t* temp = nullptr; + + if (length < 0 || length > 268435456LL) + { + return 0; + } + + size = 8 * ceil(length / 4.0); // Calculating size of temporary array. Not very precise. + temp = new uint8_t[size]; + + if (length > 0) + { + int buffer = in[0]; + int next = 1; + int bitsLeft = 8; + + while (count < bufSize && (bitsLeft > 0 || next < length)) + { + if (bitsLeft < 5) + { + if (next < length) + { + buffer <<= 8; + buffer |= in[next] & 0xFF; + next++; + bitsLeft += 8; + } + else + { + int pad = 5 - bitsLeft; + buffer <<= pad; + bitsLeft += pad; + } + } + index = 0x1F & (buffer >> (bitsLeft -5)); + + bitsLeft -= 5; + temp[result] = (uint8_t)base32StandardAlphabet[index]; + result++; + } + } + + if (usePadding) + { + int pads = (result % 8); + if (pads > 0) + { + pads = (8 - pads); + for (int i = 0; i < pads; i++) + { + temp[result] = standardPaddingChar; + result++; + } + } + } + + out = new uint8_t[result]; + + memcpy(out, temp, result); + delete [] temp; + + return result; +} + +int FdskCalculator::fromBase32(uint8_t* in, long length, uint8_t*& out) +{ + int result = 0; // Length of the array of decoded values. + int buffer = 0; + int bitsLeft = 0; + uint8_t* temp = NULL; + + temp = new uint8_t[length]; // Allocating temporary array. + + for (int i = 0; i < length; i++) + { + uint8_t ch = in[i]; + + // ignoring some characters: ' ', '\t', '\r', '\n', '=' + if (ch == 0xA0 || ch == 0x09 || ch == 0x0A || ch == 0x0D || ch == 0x3D) + continue; + + // recovering mistyped: '0' -> 'O', '1' -> 'L', '8' -> 'B' + if (ch == 0x30) + { + ch = 0x4F; + } + else if (ch == 0x31) + { + ch = 0x4C; + } + else if (ch == 0x38) + { + ch = 0x42; + } + + + // look up one base32 symbols: from 'A' to 'Z' or from 'a' to 'z' or from '2' to '7' + if ((ch >= 0x41 && ch <= 0x5A) || (ch >= 0x61 && ch <= 0x7A)) + { + ch = ((ch & 0x1F) - 1); + } + else if (ch >= 0x32 && ch <= 0x37) + { + ch -= (0x32 - 26); + } + else { + delete [] temp; + return 0; + } + + buffer <<= 5; + buffer |= ch; + bitsLeft += 5; + if (bitsLeft >= 8) + { + temp[result] = (unsigned char)((unsigned int)(buffer >> (bitsLeft - 8)) & 0xFF); + result++; + bitsLeft -= 8; + } + } + + out = new uint8_t[result]; + memcpy(out, temp, result); + delete [] temp; + + return result; +} + diff --git a/examples/knx-linux/fdsk.h b/examples/knx-linux/fdsk.h new file mode 100644 index 0000000..560ba22 --- /dev/null +++ b/examples/knx-linux/fdsk.h @@ -0,0 +1,37 @@ +#pragma once + +#include + +class FdskCalculator +{ + public: + int snprintFdsk(char* str, int strSize, uint8_t* serialNumber, uint8_t* key); + + private: + char* generateFdskString(uint8_t* serialNumber, uint8_t* key); + + int toBase32(uint8_t* in, long length, uint8_t*& out, bool usePadding); + int fromBase32(uint8_t* in, long length, uint8_t*& out); + + uint8_t crc4Array(uint8_t* data, uint8_t len) { + uint8_t start = 0; + for (uint8_t i = 0; i > 4; + c = crc4_tab[c ^ high4Bits]; + c = crc4_tab[c ^ low4Bits]; + + return c; + } + + int ceil(float num); + + static const uint8_t crc4_tab[16]; +}; diff --git a/examples/knx-linux/gcc_Debug.h b/examples/knx-linux/gcc_Debug.h new file mode 100644 index 0000000..e4f1569 --- /dev/null +++ b/examples/knx-linux/gcc_Debug.h @@ -0,0 +1,889 @@ +/* + This file is only used by IntelliSense (VisualStudio code suggestion system) + DO NOT INCLUDE THIS FILE FROM YOUR ACTUAL SOURCE FILES. + This file lists the preprocessor macros extracted from your GCC. + It is needed for IntelliSense to parse other header files correctly. +*/ +#if defined(_MSC_VER) || defined (__SYSPROGS_CODESENSE__) +#pragma clang diagnostic push + +#pragma clang diagnostic ignored "-Wreserved-id-macro" +#ifndef __DBL_MIN_EXP__ +#define __DBL_MIN_EXP__ (-1021) +#endif +#ifndef __cpp_attributes +#define __cpp_attributes 200809 +#endif +#ifndef __UINT_LEAST16_MAX__ +#define __UINT_LEAST16_MAX__ 0xffff +#endif +#ifndef __ATOMIC_ACQUIRE +#define __ATOMIC_ACQUIRE 2 +#endif +#ifndef __FLT_MIN__ +#define __FLT_MIN__ 1.17549435082228750797e-38F +#endif +#ifndef __GCC_IEC_559_COMPLEX +#define __GCC_IEC_559_COMPLEX 2 +#endif +#ifndef __cpp_aggregate_nsdmi +#define __cpp_aggregate_nsdmi 201304 +#endif +#ifndef __UINT_LEAST8_TYPE__ +#define __UINT_LEAST8_TYPE__ unsigned char +#endif +#ifndef __SIZEOF_FLOAT80__ +#define __SIZEOF_FLOAT80__ 16 +#endif +#ifndef __CHAR_BIT__ +#define __CHAR_BIT__ 8 +#endif +#ifndef __UINT8_MAX__ +#define __UINT8_MAX__ 0xff +#endif +#ifndef __WINT_MAX__ +#define __WINT_MAX__ 0xffffffffU +#endif +#ifndef __cpp_static_assert +#define __cpp_static_assert 200410 +#endif +#ifndef __ORDER_LITTLE_ENDIAN__ +#define __ORDER_LITTLE_ENDIAN__ 1234 +#endif +#ifndef __SIZE_MAX__ +#define __SIZE_MAX__ 0xffffffffffffffffUL +#endif +#ifndef __WCHAR_MAX__ +#define __WCHAR_MAX__ 0x7fffffff +#endif +#ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 +#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1 +#endif +#ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 +#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1 +#endif +#ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 +#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1 +#endif +#ifndef __DBL_DENORM_MIN__ +#define __DBL_DENORM_MIN__ double(4.94065645841246544177e-324L) +#endif +#ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 +#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1 +#endif +#ifndef __GCC_ATOMIC_CHAR_LOCK_FREE +#define __GCC_ATOMIC_CHAR_LOCK_FREE 2 +#endif +#ifndef __GCC_IEC_559 +#define __GCC_IEC_559 2 +#endif +#ifndef __FLT_EVAL_METHOD__ +#define __FLT_EVAL_METHOD__ 0 +#endif +#ifndef __unix__ +#define __unix__ 1 +#endif +#ifndef __cpp_binary_literals +#define __cpp_binary_literals 201304 +#endif +#ifndef __GCC_ATOMIC_CHAR32_T_LOCK_FREE +#define __GCC_ATOMIC_CHAR32_T_LOCK_FREE 2 +#endif +#ifndef __x86_64 +#define __x86_64 1 +#endif +#ifndef __cpp_variadic_templates +#define __cpp_variadic_templates 200704 +#endif +#ifndef __UINT_FAST64_MAX__ +#define __UINT_FAST64_MAX__ 0xffffffffffffffffUL +#endif +#ifndef __SIG_ATOMIC_TYPE__ +#define __SIG_ATOMIC_TYPE__ int +#endif +#ifndef __DBL_MIN_10_EXP__ +#define __DBL_MIN_10_EXP__ (-307) +#endif +#ifndef __FINITE_MATH_ONLY__ +#define __FINITE_MATH_ONLY__ 0 +#endif +#ifndef __cpp_variable_templates +#define __cpp_variable_templates 201304 +#endif +#ifndef __GNUC_PATCHLEVEL__ +#define __GNUC_PATCHLEVEL__ 0 +#endif +#ifndef __UINT_FAST8_MAX__ +#define __UINT_FAST8_MAX__ 0xff +#endif +#ifndef __DEC64_MAX_EXP__ +#define __DEC64_MAX_EXP__ 385 +#endif +#ifndef __UINT_LEAST64_MAX__ +#define __UINT_LEAST64_MAX__ 0xffffffffffffffffUL +#endif +#ifndef __SHRT_MAX__ +#define __SHRT_MAX__ 0x7fff +#endif +#ifndef __LDBL_MAX__ +#define __LDBL_MAX__ 1.18973149535723176502e+4932L +#endif +#ifndef __UINT_LEAST8_MAX__ +#define __UINT_LEAST8_MAX__ 0xff +#endif +#ifndef __GCC_ATOMIC_BOOL_LOCK_FREE +#define __GCC_ATOMIC_BOOL_LOCK_FREE 2 +#endif +#ifndef __UINTMAX_TYPE__ +#define __UINTMAX_TYPE__ long unsigned int +#endif +#ifndef __linux +#define __linux 1 +#endif +#ifndef __DEC32_EPSILON__ +#define __DEC32_EPSILON__ 1E-6DF +#endif +#ifndef __unix +#define __unix 1 +#endif +#ifndef __UINT32_MAX__ +#define __UINT32_MAX__ 0xffffffffU +#endif +#if !defined(__GXX_EXPERIMENTAL_CXX0X__) && defined(__SYSPROGS_CODESENSE__) +#define __GXX_EXPERIMENTAL_CXX0X__ 1 +#endif +#ifndef __LDBL_MAX_EXP__ +#define __LDBL_MAX_EXP__ 16384 +#endif +#ifndef __WINT_MIN__ +#define __WINT_MIN__ 0U +#endif +#ifndef __linux__ +#define __linux__ 1 +#endif +#ifndef __SCHAR_MAX__ +#define __SCHAR_MAX__ 0x7f +#endif +#ifndef __WCHAR_MIN__ +#define __WCHAR_MIN__ (-__WCHAR_MAX__ - 1) +#endif +#ifndef __DBL_DIG__ +#define __DBL_DIG__ 15 +#endif +#ifndef __GCC_ATOMIC_POINTER_LOCK_FREE +#define __GCC_ATOMIC_POINTER_LOCK_FREE 2 +#endif +#ifndef __SIZEOF_INT__ +#define __SIZEOF_INT__ 4 +#endif +#ifndef __SIZEOF_POINTER__ +#define __SIZEOF_POINTER__ 8 +#endif +#ifndef __GCC_ATOMIC_CHAR16_T_LOCK_FREE +#define __GCC_ATOMIC_CHAR16_T_LOCK_FREE 2 +#endif +#ifndef __USER_LABEL_PREFIX__ +#define __USER_LABEL_PREFIX__ +#endif +#ifndef __STDC_HOSTED__ +#define __STDC_HOSTED__ 1 +#endif +#ifndef __LDBL_HAS_INFINITY__ +#define __LDBL_HAS_INFINITY__ 1 +#endif +#ifndef __FLT_EPSILON__ +#define __FLT_EPSILON__ 1.19209289550781250000e-7F +#endif +#ifndef __GXX_WEAK__ +#define __GXX_WEAK__ 1 +#endif +#ifndef __LDBL_MIN__ +#define __LDBL_MIN__ 3.36210314311209350626e-4932L +#endif +#ifndef __DEC32_MAX__ +#define __DEC32_MAX__ 9.999999E96DF +#endif +#ifndef __INT32_MAX__ +#define __INT32_MAX__ 0x7fffffff +#endif +#ifndef __SIZEOF_LONG__ +#define __SIZEOF_LONG__ 8 +#endif +#ifndef __STDC_IEC_559__ +#define __STDC_IEC_559__ 1 +#endif +#ifndef __STDC_ISO_10646__ +#define __STDC_ISO_10646__ 201605L +#endif +#ifndef __DECIMAL_DIG__ +#define __DECIMAL_DIG__ 21 +#endif +#ifndef __gnu_linux__ +#define __gnu_linux__ 1 +#endif +#ifndef __LDBL_HAS_QUIET_NAN__ +#define __LDBL_HAS_QUIET_NAN__ 1 +#endif +#ifndef __GNUC__ +#define __GNUC__ 6 +#endif +#ifndef __GXX_RTTI +#define __GXX_RTTI 1 +#endif +#ifndef __pie__ +#define __pie__ 2 +#endif +#ifndef __MMX__ +#define __MMX__ 1 +#endif +#ifndef __cpp_delegating_constructors +#define __cpp_delegating_constructors 200604 +#endif +#ifndef __FLT_HAS_DENORM__ +#define __FLT_HAS_DENORM__ 1 +#endif +#ifndef __SIZEOF_LONG_DOUBLE__ +#define __SIZEOF_LONG_DOUBLE__ 16 +#endif +#ifndef __BIGGEST_ALIGNMENT__ +#define __BIGGEST_ALIGNMENT__ 16 +#endif +#ifndef __STDC_UTF_16__ +#define __STDC_UTF_16__ 1 +#endif +#ifndef __DBL_MAX__ +#define __DBL_MAX__ double(1.79769313486231570815e+308L) +#endif +#ifndef __cpp_raw_strings +#define __cpp_raw_strings 200710 +#endif +#ifndef __INT_FAST32_MAX__ +#define __INT_FAST32_MAX__ 0x7fffffffffffffffL +#endif +#ifndef __DBL_HAS_INFINITY__ +#define __DBL_HAS_INFINITY__ 1 +#endif +#ifndef __INT64_MAX__ +#define __INT64_MAX__ 0x7fffffffffffffffL +#endif +#ifndef __DEC32_MIN_EXP__ +#define __DEC32_MIN_EXP__ (-94) +#endif +#ifndef __INT_FAST16_TYPE__ +#define __INT_FAST16_TYPE__ long int +#endif +#ifndef __LDBL_HAS_DENORM__ +#define __LDBL_HAS_DENORM__ 1 +#endif +//VS2005-2012 treats all files as C++, while VS2013+ can treat C files correctly. +#if defined(_MSC_VER) && (_MSC_VER < 1800 || defined(__cplusplus)) +#undef __cplusplus +#define __cplusplus 201402L +#endif +#ifndef __cpp_ref_qualifiers +#define __cpp_ref_qualifiers 200710 +#endif +#ifndef __DEC128_MAX__ +#define __DEC128_MAX__ 9.999999999999999999999999999999999E6144DL +#endif +#ifndef __INT_LEAST32_MAX__ +#define __INT_LEAST32_MAX__ 0x7fffffff +#endif +#ifndef __DEC32_MIN__ +#define __DEC32_MIN__ 1E-95DF +#endif +#ifndef __DEPRECATED +#define __DEPRECATED 1 +#endif +#ifndef __cpp_rvalue_references +#define __cpp_rvalue_references 200610 +#endif +#ifndef __DBL_MAX_EXP__ +#define __DBL_MAX_EXP__ 1024 +#endif +#ifndef __DEC128_EPSILON__ +#define __DEC128_EPSILON__ 1E-33DL +#endif +#ifndef __SSE2_MATH__ +#define __SSE2_MATH__ 1 +#endif +#ifndef __ATOMIC_HLE_RELEASE +#define __ATOMIC_HLE_RELEASE 131072 +#endif +#ifndef __PTRDIFF_MAX__ +#define __PTRDIFF_MAX__ 0x7fffffffffffffffL +#endif +#ifndef __amd64 +#define __amd64 1 +#endif +#ifndef __STDC_NO_THREADS__ +#define __STDC_NO_THREADS__ 1 +#endif +#ifndef __ATOMIC_HLE_ACQUIRE +#define __ATOMIC_HLE_ACQUIRE 65536 +#endif +#ifndef __GNUG__ +#define __GNUG__ 6 +#endif +#ifndef __LONG_LONG_MAX__ +#define __LONG_LONG_MAX__ 0x7fffffffffffffffLL +#endif +#ifndef __SIZEOF_SIZE_T__ +#define __SIZEOF_SIZE_T__ 8 +#endif +#ifndef __cpp_rvalue_reference +#define __cpp_rvalue_reference 200610 +#endif +#ifndef __cpp_nsdmi +#define __cpp_nsdmi 200809 +#endif +#ifndef __SIZEOF_WINT_T__ +#define __SIZEOF_WINT_T__ 4 +#endif +#ifndef __cpp_initializer_lists +#define __cpp_initializer_lists 200806 +#endif +#ifndef __cpp_hex_float +#define __cpp_hex_float 201603 +#endif +#ifndef __GCC_HAVE_DWARF2_CFI_ASM +#define __GCC_HAVE_DWARF2_CFI_ASM 1 +#endif +#ifndef __GXX_ABI_VERSION +#define __GXX_ABI_VERSION 1010 +#endif +#ifndef __FLT_MIN_EXP__ +#define __FLT_MIN_EXP__ (-125) +#endif +#ifndef __cpp_lambdas +#define __cpp_lambdas 200907 +#endif +#ifndef __INT_FAST64_TYPE__ +#define __INT_FAST64_TYPE__ long int +#endif +#ifndef __DBL_MIN__ +#define __DBL_MIN__ double(2.22507385850720138309e-308L) +#endif +#ifndef __PIE__ +#define __PIE__ 2 +#endif +#ifndef __LP64__ +#define __LP64__ 1 +#endif +#ifndef __DECIMAL_BID_FORMAT__ +#define __DECIMAL_BID_FORMAT__ 1 +#endif +#ifndef __DEC128_MIN__ +#define __DEC128_MIN__ 1E-6143DL +#endif +#ifndef __REGISTER_PREFIX__ +#define __REGISTER_PREFIX__ +#endif +#ifndef __UINT16_MAX__ +#define __UINT16_MAX__ 0xffff +#endif +#ifndef __DBL_HAS_DENORM__ +#define __DBL_HAS_DENORM__ 1 +#endif +#ifndef __UINT8_TYPE__ +#define __UINT8_TYPE__ unsigned char +#endif +#ifndef __NO_INLINE__ +#define __NO_INLINE__ 1 +#endif +#ifndef __FLT_MANT_DIG__ +#define __FLT_MANT_DIG__ 24 +#endif +#ifndef __VERSION__ +#define __VERSION__ "6.3.0 20170516" +#endif +#ifndef __cpp_unicode_characters +#define __cpp_unicode_characters 200704 +#endif +#ifndef _STDC_PREDEF_H +#define _STDC_PREDEF_H 1 +#endif +#ifndef __cpp_decltype_auto +#define __cpp_decltype_auto 201304 +#endif +#ifndef __GCC_ATOMIC_INT_LOCK_FREE +#define __GCC_ATOMIC_INT_LOCK_FREE 2 +#endif +#ifndef __FLOAT_WORD_ORDER__ +#define __FLOAT_WORD_ORDER__ __ORDER_LITTLE_ENDIAN__ +#endif +#ifndef __STDC_IEC_559_COMPLEX__ +#define __STDC_IEC_559_COMPLEX__ 1 +#endif +#ifndef __DEC64_EPSILON__ +#define __DEC64_EPSILON__ 1E-15DD +#endif +#ifndef __ORDER_PDP_ENDIAN__ +#define __ORDER_PDP_ENDIAN__ 3412 +#endif +#ifndef __DEC128_MIN_EXP__ +#define __DEC128_MIN_EXP__ (-6142) +#endif +#ifndef __INT_FAST32_TYPE__ +#define __INT_FAST32_TYPE__ long int +#endif +#ifndef __UINT_LEAST16_TYPE__ +#define __UINT_LEAST16_TYPE__ short unsigned int +#endif +#ifndef unix +#define unix 1 +#endif +#ifndef __INT16_MAX__ +#define __INT16_MAX__ 0x7fff +#endif +#ifndef __cpp_rtti +#define __cpp_rtti 199711 +#endif +#ifndef __SIZE_TYPE__ +#define __SIZE_TYPE__ long unsigned int +#endif +#ifndef __UINT64_MAX__ +#define __UINT64_MAX__ 0xffffffffffffffffUL +#endif +#ifndef __INT8_TYPE__ +#define __INT8_TYPE__ signed char +#endif +#ifndef __cpp_digit_separators +#define __cpp_digit_separators 201309 +#endif +#ifndef __ELF__ +#define __ELF__ 1 +#endif +#ifndef __GCC_ASM_FLAG_OUTPUTS__ +#define __GCC_ASM_FLAG_OUTPUTS__ 1 +#endif +#ifndef __FLT_RADIX__ +#define __FLT_RADIX__ 2 +#endif +#ifndef __INT_LEAST16_TYPE__ +#define __INT_LEAST16_TYPE__ short int +#endif +#ifndef __LDBL_EPSILON__ +#define __LDBL_EPSILON__ 1.08420217248550443401e-19L +#endif +#ifndef __GLIBCXX_BITSIZE_INT_N_0 +#define __GLIBCXX_BITSIZE_INT_N_0 128 +#endif +#ifndef __k8 +#define __k8 1 +#endif +#ifndef __SIG_ATOMIC_MAX__ +#define __SIG_ATOMIC_MAX__ 0x7fffffff +#endif +#ifndef __GCC_ATOMIC_WCHAR_T_LOCK_FREE +#define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 2 +#endif +#ifndef __cpp_sized_deallocation +#define __cpp_sized_deallocation 201309 +#endif +#ifndef __SIZEOF_PTRDIFF_T__ +#define __SIZEOF_PTRDIFF_T__ 8 +#endif +#ifndef __x86_64__ +#define __x86_64__ 1 +#endif +#ifndef __DEC32_SUBNORMAL_MIN__ +#define __DEC32_SUBNORMAL_MIN__ 0.000001E-95DF +#endif +#ifndef __INT_FAST16_MAX__ +#define __INT_FAST16_MAX__ 0x7fffffffffffffffL +#endif +#ifndef __UINT_FAST32_MAX__ +#define __UINT_FAST32_MAX__ 0xffffffffffffffffUL +#endif +#ifndef __UINT_LEAST64_TYPE__ +#define __UINT_LEAST64_TYPE__ long unsigned int +#endif +#ifndef __FLT_HAS_QUIET_NAN__ +#define __FLT_HAS_QUIET_NAN__ 1 +#endif +#ifndef __FLT_MAX_10_EXP__ +#define __FLT_MAX_10_EXP__ 38 +#endif +#ifndef __LONG_MAX__ +#define __LONG_MAX__ 0x7fffffffffffffffL +#endif +#ifndef __DEC128_SUBNORMAL_MIN__ +#define __DEC128_SUBNORMAL_MIN__ 0.000000000000000000000000000000001E-6143DL +#endif +#ifndef __FLT_HAS_INFINITY__ +#define __FLT_HAS_INFINITY__ 1 +#endif +#ifndef __cpp_unicode_literals +#define __cpp_unicode_literals 200710 +#endif +#ifndef __UINT_FAST16_TYPE__ +#define __UINT_FAST16_TYPE__ long unsigned int +#endif +#ifndef __DEC64_MAX__ +#define __DEC64_MAX__ 9.999999999999999E384DD +#endif +#ifndef __CHAR16_TYPE__ +#define __CHAR16_TYPE__ short unsigned int +#endif +#ifndef __PRAGMA_REDEFINE_EXTNAME +#define __PRAGMA_REDEFINE_EXTNAME 1 +#endif +#ifndef __SEG_FS +#define __SEG_FS 1 +#endif +#ifndef __INT_LEAST16_MAX__ +#define __INT_LEAST16_MAX__ 0x7fff +#endif +#ifndef __DEC64_MANT_DIG__ +#define __DEC64_MANT_DIG__ 16 +#endif +#ifndef __UINT_LEAST32_MAX__ +#define __UINT_LEAST32_MAX__ 0xffffffffU +#endif +#ifndef __SEG_GS +#define __SEG_GS 1 +#endif +#ifndef __GCC_ATOMIC_LONG_LOCK_FREE +#define __GCC_ATOMIC_LONG_LOCK_FREE 2 +#endif +#ifndef __INT_LEAST64_TYPE__ +#define __INT_LEAST64_TYPE__ long int +#endif +#ifndef __INT16_TYPE__ +#define __INT16_TYPE__ short int +#endif +#ifndef __INT_LEAST8_TYPE__ +#define __INT_LEAST8_TYPE__ signed char +#endif +#ifndef __DEC32_MAX_EXP__ +#define __DEC32_MAX_EXP__ 97 +#endif +#ifndef __INT_FAST8_MAX__ +#define __INT_FAST8_MAX__ 0x7f +#endif +#ifndef __INTPTR_MAX__ +#define __INTPTR_MAX__ 0x7fffffffffffffffL +#endif +#ifndef linux +#define linux 1 +#endif +#ifndef __cpp_range_based_for +#define __cpp_range_based_for 200907 +#endif +#ifndef __SSE2__ +#define __SSE2__ 1 +#endif +#ifndef __EXCEPTIONS +#define __EXCEPTIONS 1 +#endif +#ifndef __LDBL_MANT_DIG__ +#define __LDBL_MANT_DIG__ 64 +#endif +#ifndef __DBL_HAS_QUIET_NAN__ +#define __DBL_HAS_QUIET_NAN__ 1 +#endif +#ifndef __SIG_ATOMIC_MIN__ +#define __SIG_ATOMIC_MIN__ (-__SIG_ATOMIC_MAX__ - 1) +#endif +#ifndef __code_model_small__ +#define __code_model_small__ 1 +#endif +#ifndef __cpp_return_type_deduction +#define __cpp_return_type_deduction 201304 +#endif +#ifndef __k8__ +#define __k8__ 1 +#endif +#ifndef __INTPTR_TYPE__ +#define __INTPTR_TYPE__ long int +#endif +#ifndef __UINT16_TYPE__ +#define __UINT16_TYPE__ short unsigned int +#endif +#ifndef __WCHAR_TYPE__ +#define __WCHAR_TYPE__ int +#endif +#ifndef __SIZEOF_FLOAT__ +#define __SIZEOF_FLOAT__ 4 +#endif +#ifndef __pic__ +#define __pic__ 2 +#endif +#ifndef __UINTPTR_MAX__ +#define __UINTPTR_MAX__ 0xffffffffffffffffUL +#endif +#ifndef __DEC64_MIN_EXP__ +#define __DEC64_MIN_EXP__ (-382) +#endif +#ifndef __cpp_decltype +#define __cpp_decltype 200707 +#endif +#ifndef __INT_FAST64_MAX__ +#define __INT_FAST64_MAX__ 0x7fffffffffffffffL +#endif +#ifndef __GCC_ATOMIC_TEST_AND_SET_TRUEVAL +#define __GCC_ATOMIC_TEST_AND_SET_TRUEVAL 1 +#endif +#ifndef __FLT_DIG__ +#define __FLT_DIG__ 6 +#endif +#ifndef __UINT_FAST64_TYPE__ +#define __UINT_FAST64_TYPE__ long unsigned int +#endif +#ifndef __INT_MAX__ +#define __INT_MAX__ 0x7fffffff +#endif +#ifndef __amd64__ +#define __amd64__ 1 +#endif +#ifndef __INT64_TYPE__ +#define __INT64_TYPE__ long int +#endif +#ifndef __FLT_MAX_EXP__ +#define __FLT_MAX_EXP__ 128 +#endif +#ifndef __ORDER_BIG_ENDIAN__ +#define __ORDER_BIG_ENDIAN__ 4321 +#endif +#ifndef __DBL_MANT_DIG__ +#define __DBL_MANT_DIG__ 53 +#endif +#ifndef __cpp_inheriting_constructors +#define __cpp_inheriting_constructors 200802 +#endif +#ifndef __SIZEOF_FLOAT128__ +#define __SIZEOF_FLOAT128__ 16 +#endif +#ifndef __INT_LEAST64_MAX__ +#define __INT_LEAST64_MAX__ 0x7fffffffffffffffL +#endif +#ifndef __DEC64_MIN__ +#define __DEC64_MIN__ 1E-383DD +#endif +#ifndef __WINT_TYPE__ +#define __WINT_TYPE__ unsigned int +#endif +#ifndef __UINT_LEAST32_TYPE__ +#define __UINT_LEAST32_TYPE__ unsigned int +#endif +#ifndef __SIZEOF_SHORT__ +#define __SIZEOF_SHORT__ 2 +#endif +#ifndef __SSE__ +#define __SSE__ 1 +#endif +#ifndef __LDBL_MIN_EXP__ +#define __LDBL_MIN_EXP__ (-16381) +#endif +#ifndef __INT_LEAST8_MAX__ +#define __INT_LEAST8_MAX__ 0x7f +#endif +#ifndef __SIZEOF_INT128__ +#define __SIZEOF_INT128__ 16 +#endif +#ifndef __LDBL_MAX_10_EXP__ +#define __LDBL_MAX_10_EXP__ 4932 +#endif +#ifndef __ATOMIC_RELAXED +#define __ATOMIC_RELAXED 0 +#endif +#ifndef __DBL_EPSILON__ +#define __DBL_EPSILON__ double(2.22044604925031308085e-16L) +#endif +#ifndef _LP64 +#define _LP64 1 +#endif +#ifndef __INT_LEAST32_TYPE__ +#define __INT_LEAST32_TYPE__ int +#endif +#ifndef __SIZEOF_WCHAR_T__ +#define __SIZEOF_WCHAR_T__ 4 +#endif +#ifndef __UINT64_TYPE__ +#define __UINT64_TYPE__ long unsigned int +#endif +#ifndef __INT_FAST8_TYPE__ +#define __INT_FAST8_TYPE__ signed char +#endif +#ifndef __GNUC_STDC_INLINE__ +#define __GNUC_STDC_INLINE__ 1 +#endif +#ifndef __DBL_DECIMAL_DIG__ +#define __DBL_DECIMAL_DIG__ 17 +#endif +#ifndef __STDC_UTF_32__ +#define __STDC_UTF_32__ 1 +#endif +#ifndef __FXSR__ +#define __FXSR__ 1 +#endif +#ifndef __DEC_EVAL_METHOD__ +#define __DEC_EVAL_METHOD__ 2 +#endif +#ifndef __cpp_runtime_arrays +#define __cpp_runtime_arrays 198712 +#endif +#ifndef __INTMAX_MAX__ +#define __INTMAX_MAX__ 0x7fffffffffffffffL +#endif +#ifndef __cpp_alias_templates +#define __cpp_alias_templates 200704 +#endif +#ifndef __BYTE_ORDER__ +#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__ +#endif +#ifndef __FLT_DENORM_MIN__ +#define __FLT_DENORM_MIN__ 1.40129846432481707092e-45F +#endif +#ifndef __INT8_MAX__ +#define __INT8_MAX__ 0x7f +#endif +#ifndef __PIC__ +#define __PIC__ 2 +#endif +#ifndef __UINT_FAST32_TYPE__ +#define __UINT_FAST32_TYPE__ long unsigned int +#endif +#ifndef __CHAR32_TYPE__ +#define __CHAR32_TYPE__ unsigned int +#endif +#ifndef __FLT_MAX__ +#define __FLT_MAX__ 3.40282346638528859812e+38F +#endif +#ifndef __cpp_constexpr +#define __cpp_constexpr 201304 +#endif +#ifndef __INT32_TYPE__ +#define __INT32_TYPE__ int +#endif +#ifndef __SIZEOF_DOUBLE__ +#define __SIZEOF_DOUBLE__ 8 +#endif +#ifndef __cpp_exceptions +#define __cpp_exceptions 199711 +#endif +#ifndef __INTMAX_TYPE__ +#define __INTMAX_TYPE__ long int +#endif +#ifndef __DEC128_MAX_EXP__ +#define __DEC128_MAX_EXP__ 6145 +#endif +#ifndef __ATOMIC_CONSUME +#define __ATOMIC_CONSUME 1 +#endif +#ifndef __GNUC_MINOR__ +#define __GNUC_MINOR__ 3 +#endif +#ifndef __GLIBCXX_TYPE_INT_N_0 +#define __GLIBCXX_TYPE_INT_N_0 __int128 +#endif +#ifndef __UINTMAX_MAX__ +#define __UINTMAX_MAX__ 0xffffffffffffffffUL +#endif +#ifndef __DEC32_MANT_DIG__ +#define __DEC32_MANT_DIG__ 7 +#endif +#ifndef __DBL_MAX_10_EXP__ +#define __DBL_MAX_10_EXP__ 308 +#endif +#ifndef __LDBL_DENORM_MIN__ +#define __LDBL_DENORM_MIN__ 3.64519953188247460253e-4951L +#endif +#ifndef __cpp_generic_lambdas +#define __cpp_generic_lambdas 201304 +#endif +#ifndef __STDC__ +#define __STDC__ 1 +#endif +#ifndef __PTRDIFF_TYPE__ +#define __PTRDIFF_TYPE__ long int +#endif +#ifndef __ATOMIC_SEQ_CST +#define __ATOMIC_SEQ_CST 5 +#endif +#ifndef __UINT32_TYPE__ +#define __UINT32_TYPE__ unsigned int +#endif +#ifndef __UINTPTR_TYPE__ +#define __UINTPTR_TYPE__ long unsigned int +#endif +#ifndef __DEC64_SUBNORMAL_MIN__ +#define __DEC64_SUBNORMAL_MIN__ 0.000000000000001E-383DD +#endif +#ifndef __DEC128_MANT_DIG__ +#define __DEC128_MANT_DIG__ 34 +#endif +#ifndef __LDBL_MIN_10_EXP__ +#define __LDBL_MIN_10_EXP__ (-4931) +#endif +#ifndef __SSE_MATH__ +#define __SSE_MATH__ 1 +#endif +#ifndef __SIZEOF_LONG_LONG__ +#define __SIZEOF_LONG_LONG__ 8 +#endif +#ifndef __cpp_user_defined_literals +#define __cpp_user_defined_literals 200809 +#endif +#ifndef __GCC_ATOMIC_LLONG_LOCK_FREE +#define __GCC_ATOMIC_LLONG_LOCK_FREE 2 +#endif +#ifndef __LDBL_DIG__ +#define __LDBL_DIG__ 18 +#endif +#ifndef __FLT_DECIMAL_DIG__ +#define __FLT_DECIMAL_DIG__ 9 +#endif +#ifndef __UINT_FAST16_MAX__ +#define __UINT_FAST16_MAX__ 0xffffffffffffffffUL +#endif +#ifndef __FLT_MIN_10_EXP__ +#define __FLT_MIN_10_EXP__ (-37) +#endif +#ifndef __GCC_ATOMIC_SHORT_LOCK_FREE +#define __GCC_ATOMIC_SHORT_LOCK_FREE 2 +#endif +#ifndef __UINT_FAST8_TYPE__ +#define __UINT_FAST8_TYPE__ unsigned char +#endif +#ifndef _GNU_SOURCE +#define _GNU_SOURCE 1 +#endif +#ifndef __cpp_init_captures +#define __cpp_init_captures 201304 +#endif +#ifndef __ATOMIC_ACQ_REL +#define __ATOMIC_ACQ_REL 4 +#endif +#ifndef __ATOMIC_RELEASE +#define __ATOMIC_RELEASE 3 +#endif +#endif + +// --- Include directories begin --- // +///usr/include/c++/6 +///usr/include/x86_64-linux-gnu/c++/6 +///usr/include/c++/6/backward +///usr/lib/gcc/x86_64-linux-gnu/6/include +///usr/local/include +///usr/lib/gcc/x86_64-linux-gnu/6/include-fixed +///usr/include/x86_64-linux-gnu +///usr/include +// --- Include directories end --- // + + +// --- Library directories begin --- // +///usr/lib/gcc/x86_64-linux-gnu/6/ +///usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/ +///usr/lib/gcc/x86_64-linux-gnu/6/../../../../lib/ +///lib/x86_64-linux-gnu/ +///lib/../lib/ +///usr/lib/x86_64-linux-gnu/ +///usr/lib/../lib/ +///usr/lib/gcc/x86_64-linux-gnu/6/../../../ +///lib/ +///usr/lib/ +// --- Library directories begin --- // + +#pragma clang diagnostic pop diff --git a/examples/knx-linux/gcc_Release.h b/examples/knx-linux/gcc_Release.h new file mode 100644 index 0000000..5f82ca2 --- /dev/null +++ b/examples/knx-linux/gcc_Release.h @@ -0,0 +1,895 @@ +/* + This file is only used by IntelliSense (VisualStudio code suggestion system) + DO NOT INCLUDE THIS FILE FROM YOUR ACTUAL SOURCE FILES. + This file lists the preprocessor macros extracted from your GCC. + It is needed for IntelliSense to parse other header files correctly. +*/ +#if defined(_MSC_VER) || defined (__SYSPROGS_CODESENSE__) +#pragma clang diagnostic push + +#pragma clang diagnostic ignored "-Wreserved-id-macro" +#ifndef __DBL_MIN_EXP__ +#define __DBL_MIN_EXP__ (-1021) +#endif +#ifndef __cpp_attributes +#define __cpp_attributes 200809 +#endif +#ifndef __UINT_LEAST16_MAX__ +#define __UINT_LEAST16_MAX__ 0xffff +#endif +#ifndef __ATOMIC_ACQUIRE +#define __ATOMIC_ACQUIRE 2 +#endif +#ifndef __FLT_MIN__ +#define __FLT_MIN__ 1.17549435082228750797e-38F +#endif +#ifndef __GCC_IEC_559_COMPLEX +#define __GCC_IEC_559_COMPLEX 2 +#endif +#ifndef __cpp_aggregate_nsdmi +#define __cpp_aggregate_nsdmi 201304 +#endif +#ifndef __UINT_LEAST8_TYPE__ +#define __UINT_LEAST8_TYPE__ unsigned char +#endif +#ifndef __SIZEOF_FLOAT80__ +#define __SIZEOF_FLOAT80__ 16 +#endif +#ifndef __CHAR_BIT__ +#define __CHAR_BIT__ 8 +#endif +#ifndef __UINT8_MAX__ +#define __UINT8_MAX__ 0xff +#endif +#ifndef __WINT_MAX__ +#define __WINT_MAX__ 0xffffffffU +#endif +#ifndef __cpp_static_assert +#define __cpp_static_assert 200410 +#endif +#ifndef __ORDER_LITTLE_ENDIAN__ +#define __ORDER_LITTLE_ENDIAN__ 1234 +#endif +#ifndef __SIZE_MAX__ +#define __SIZE_MAX__ 0xffffffffffffffffUL +#endif +#ifndef __WCHAR_MAX__ +#define __WCHAR_MAX__ 0x7fffffff +#endif +#ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 +#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_1 1 +#endif +#ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 +#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_2 1 +#endif +#ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 +#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4 1 +#endif +#ifndef __DBL_DENORM_MIN__ +#define __DBL_DENORM_MIN__ double(4.94065645841246544177e-324L) +#endif +#ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 +#define __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8 1 +#endif +#ifndef __GCC_ATOMIC_CHAR_LOCK_FREE +#define __GCC_ATOMIC_CHAR_LOCK_FREE 2 +#endif +#ifndef __GCC_IEC_559 +#define __GCC_IEC_559 2 +#endif +#ifndef __FLT_EVAL_METHOD__ +#define __FLT_EVAL_METHOD__ 0 +#endif +#ifndef __unix__ +#define __unix__ 1 +#endif +#ifndef __cpp_binary_literals +#define __cpp_binary_literals 201304 +#endif +#ifndef __GCC_ATOMIC_CHAR32_T_LOCK_FREE +#define __GCC_ATOMIC_CHAR32_T_LOCK_FREE 2 +#endif +#ifndef __x86_64 +#define __x86_64 1 +#endif +#ifndef __cpp_variadic_templates +#define __cpp_variadic_templates 200704 +#endif +#ifndef __UINT_FAST64_MAX__ +#define __UINT_FAST64_MAX__ 0xffffffffffffffffUL +#endif +#ifndef __SIG_ATOMIC_TYPE__ +#define __SIG_ATOMIC_TYPE__ int +#endif +#ifndef __DBL_MIN_10_EXP__ +#define __DBL_MIN_10_EXP__ (-307) +#endif +#ifndef __FINITE_MATH_ONLY__ +#define __FINITE_MATH_ONLY__ 0 +#endif +#ifndef __cpp_variable_templates +#define __cpp_variable_templates 201304 +#endif +#ifndef __GNUC_PATCHLEVEL__ +#define __GNUC_PATCHLEVEL__ 0 +#endif +#ifndef __UINT_FAST8_MAX__ +#define __UINT_FAST8_MAX__ 0xff +#endif +#ifndef __DEC64_MAX_EXP__ +#define __DEC64_MAX_EXP__ 385 +#endif +#ifndef __UINT_LEAST64_MAX__ +#define __UINT_LEAST64_MAX__ 0xffffffffffffffffUL +#endif +#ifndef __SHRT_MAX__ +#define __SHRT_MAX__ 0x7fff +#endif +#ifndef __LDBL_MAX__ +#define __LDBL_MAX__ 1.18973149535723176502e+4932L +#endif +#ifndef __UINT_LEAST8_MAX__ +#define __UINT_LEAST8_MAX__ 0xff +#endif +#ifndef __GCC_ATOMIC_BOOL_LOCK_FREE +#define __GCC_ATOMIC_BOOL_LOCK_FREE 2 +#endif +#ifndef __UINTMAX_TYPE__ +#define __UINTMAX_TYPE__ long unsigned int +#endif +#ifndef __linux +#define __linux 1 +#endif +#ifndef __DEC32_EPSILON__ +#define __DEC32_EPSILON__ 1E-6DF +#endif +#ifndef __unix +#define __unix 1 +#endif +#ifndef __UINT32_MAX__ +#define __UINT32_MAX__ 0xffffffffU +#endif +#if !defined(__GXX_EXPERIMENTAL_CXX0X__) && defined(__SYSPROGS_CODESENSE__) +#define __GXX_EXPERIMENTAL_CXX0X__ 1 +#endif +#ifndef __LDBL_MAX_EXP__ +#define __LDBL_MAX_EXP__ 16384 +#endif +#ifndef __WINT_MIN__ +#define __WINT_MIN__ 0U +#endif +#ifndef __linux__ +#define __linux__ 1 +#endif +#ifndef __SCHAR_MAX__ +#define __SCHAR_MAX__ 0x7f +#endif +#ifndef __WCHAR_MIN__ +#define __WCHAR_MIN__ (-__WCHAR_MAX__ - 1) +#endif +#ifndef __DBL_DIG__ +#define __DBL_DIG__ 15 +#endif +#ifndef __GCC_ATOMIC_POINTER_LOCK_FREE +#define __GCC_ATOMIC_POINTER_LOCK_FREE 2 +#endif +#ifndef __SIZEOF_INT__ +#define __SIZEOF_INT__ 4 +#endif +#ifndef __SIZEOF_POINTER__ +#define __SIZEOF_POINTER__ 8 +#endif +#ifndef __GCC_ATOMIC_CHAR16_T_LOCK_FREE +#define __GCC_ATOMIC_CHAR16_T_LOCK_FREE 2 +#endif +#ifndef __USER_LABEL_PREFIX__ +#define __USER_LABEL_PREFIX__ +#endif +#ifndef __STDC_HOSTED__ +#define __STDC_HOSTED__ 1 +#endif +#ifndef __LDBL_HAS_INFINITY__ +#define __LDBL_HAS_INFINITY__ 1 +#endif +#ifndef __FLT_EPSILON__ +#define __FLT_EPSILON__ 1.19209289550781250000e-7F +#endif +#ifndef __GXX_WEAK__ +#define __GXX_WEAK__ 1 +#endif +#ifndef __LDBL_MIN__ +#define __LDBL_MIN__ 3.36210314311209350626e-4932L +#endif +#ifndef __DEC32_MAX__ +#define __DEC32_MAX__ 9.999999E96DF +#endif +#ifndef __INT32_MAX__ +#define __INT32_MAX__ 0x7fffffff +#endif +#ifndef __SIZEOF_LONG__ +#define __SIZEOF_LONG__ 8 +#endif +#ifndef __STDC_IEC_559__ +#define __STDC_IEC_559__ 1 +#endif +#ifndef __STDC_ISO_10646__ +#define __STDC_ISO_10646__ 201605L +#endif +#ifndef __DECIMAL_DIG__ +#define __DECIMAL_DIG__ 21 +#endif +#ifndef __gnu_linux__ +#define __gnu_linux__ 1 +#endif +#ifndef __LDBL_HAS_QUIET_NAN__ +#define __LDBL_HAS_QUIET_NAN__ 1 +#endif +#ifndef __GNUC__ +#define __GNUC__ 6 +#endif +#ifndef __GXX_RTTI +#define __GXX_RTTI 1 +#endif +#ifndef __pie__ +#define __pie__ 2 +#endif +#ifndef __MMX__ +#define __MMX__ 1 +#endif +#ifndef __cpp_delegating_constructors +#define __cpp_delegating_constructors 200604 +#endif +#ifndef __FLT_HAS_DENORM__ +#define __FLT_HAS_DENORM__ 1 +#endif +#ifndef __SIZEOF_LONG_DOUBLE__ +#define __SIZEOF_LONG_DOUBLE__ 16 +#endif +#ifndef __BIGGEST_ALIGNMENT__ +#define __BIGGEST_ALIGNMENT__ 16 +#endif +#ifndef __STDC_UTF_16__ +#define __STDC_UTF_16__ 1 +#endif +#ifndef __DBL_MAX__ +#define __DBL_MAX__ double(1.79769313486231570815e+308L) +#endif +#ifndef __cpp_raw_strings +#define __cpp_raw_strings 200710 +#endif +#ifndef __INT_FAST32_MAX__ +#define __INT_FAST32_MAX__ 0x7fffffffffffffffL +#endif +#ifndef __DBL_HAS_INFINITY__ +#define __DBL_HAS_INFINITY__ 1 +#endif +#ifndef __INT64_MAX__ +#define __INT64_MAX__ 0x7fffffffffffffffL +#endif +#ifndef __DEC32_MIN_EXP__ +#define __DEC32_MIN_EXP__ (-94) +#endif +#ifndef __INT_FAST16_TYPE__ +#define __INT_FAST16_TYPE__ long int +#endif +#ifndef __LDBL_HAS_DENORM__ +#define __LDBL_HAS_DENORM__ 1 +#endif +//VS2005-2012 treats all files as C++, while VS2013+ can treat C files correctly. +#if defined(_MSC_VER) && (_MSC_VER < 1800 || defined(__cplusplus)) +#undef __cplusplus +#define __cplusplus 201402L +#endif +#ifndef __cpp_ref_qualifiers +#define __cpp_ref_qualifiers 200710 +#endif +#ifndef __DEC128_MAX__ +#define __DEC128_MAX__ 9.999999999999999999999999999999999E6144DL +#endif +#ifndef __INT_LEAST32_MAX__ +#define __INT_LEAST32_MAX__ 0x7fffffff +#endif +#ifndef __DEC32_MIN__ +#define __DEC32_MIN__ 1E-95DF +#endif +#ifndef __DEPRECATED +#define __DEPRECATED 1 +#endif +#ifndef __cpp_rvalue_references +#define __cpp_rvalue_references 200610 +#endif +#ifndef __DBL_MAX_EXP__ +#define __DBL_MAX_EXP__ 1024 +#endif +#ifndef __DEC128_EPSILON__ +#define __DEC128_EPSILON__ 1E-33DL +#endif +#ifndef __SSE2_MATH__ +#define __SSE2_MATH__ 1 +#endif +#ifndef __ATOMIC_HLE_RELEASE +#define __ATOMIC_HLE_RELEASE 131072 +#endif +#ifndef __PTRDIFF_MAX__ +#define __PTRDIFF_MAX__ 0x7fffffffffffffffL +#endif +#ifndef __amd64 +#define __amd64 1 +#endif +#ifndef __STDC_NO_THREADS__ +#define __STDC_NO_THREADS__ 1 +#endif +#ifndef __ATOMIC_HLE_ACQUIRE +#define __ATOMIC_HLE_ACQUIRE 65536 +#endif +#ifndef __GNUG__ +#define __GNUG__ 6 +#endif +#ifndef __LONG_LONG_MAX__ +#define __LONG_LONG_MAX__ 0x7fffffffffffffffLL +#endif +#ifndef __SIZEOF_SIZE_T__ +#define __SIZEOF_SIZE_T__ 8 +#endif +#ifndef __cpp_rvalue_reference +#define __cpp_rvalue_reference 200610 +#endif +#ifndef __cpp_nsdmi +#define __cpp_nsdmi 200809 +#endif +#ifndef __SIZEOF_WINT_T__ +#define __SIZEOF_WINT_T__ 4 +#endif +#ifndef __cpp_initializer_lists +#define __cpp_initializer_lists 200806 +#endif +#ifndef __cpp_hex_float +#define __cpp_hex_float 201603 +#endif +#ifndef __GCC_HAVE_DWARF2_CFI_ASM +#define __GCC_HAVE_DWARF2_CFI_ASM 1 +#endif +#ifndef __GXX_ABI_VERSION +#define __GXX_ABI_VERSION 1010 +#endif +#ifndef __FLT_MIN_EXP__ +#define __FLT_MIN_EXP__ (-125) +#endif +#ifndef __cpp_lambdas +#define __cpp_lambdas 200907 +#endif +#ifndef __INT_FAST64_TYPE__ +#define __INT_FAST64_TYPE__ long int +#endif +#ifndef __DBL_MIN__ +#define __DBL_MIN__ double(2.22507385850720138309e-308L) +#endif +#ifndef __PIE__ +#define __PIE__ 2 +#endif +#ifndef __LP64__ +#define __LP64__ 1 +#endif +#ifndef __DECIMAL_BID_FORMAT__ +#define __DECIMAL_BID_FORMAT__ 1 +#endif +#ifndef __DEC128_MIN__ +#define __DEC128_MIN__ 1E-6143DL +#endif +#ifndef __REGISTER_PREFIX__ +#define __REGISTER_PREFIX__ +#endif +#ifndef __UINT16_MAX__ +#define __UINT16_MAX__ 0xffff +#endif +#ifndef __DBL_HAS_DENORM__ +#define __DBL_HAS_DENORM__ 1 +#endif +#ifndef __UINT8_TYPE__ +#define __UINT8_TYPE__ unsigned char +#endif +#ifndef __NO_INLINE__ +#define __NO_INLINE__ 1 +#endif +#ifndef __FLT_MANT_DIG__ +#define __FLT_MANT_DIG__ 24 +#endif +#ifndef __VERSION__ +#define __VERSION__ "6.3.0 20170516" +#endif +#ifndef __cpp_unicode_characters +#define __cpp_unicode_characters 200704 +#endif +#ifndef _STDC_PREDEF_H +#define _STDC_PREDEF_H 1 +#endif +#ifndef __cpp_decltype_auto +#define __cpp_decltype_auto 201304 +#endif +#ifndef __GCC_ATOMIC_INT_LOCK_FREE +#define __GCC_ATOMIC_INT_LOCK_FREE 2 +#endif +#ifndef __FLOAT_WORD_ORDER__ +#define __FLOAT_WORD_ORDER__ __ORDER_LITTLE_ENDIAN__ +#endif +#ifndef __STDC_IEC_559_COMPLEX__ +#define __STDC_IEC_559_COMPLEX__ 1 +#endif +#ifndef __DEC64_EPSILON__ +#define __DEC64_EPSILON__ 1E-15DD +#endif +#ifndef __ORDER_PDP_ENDIAN__ +#define __ORDER_PDP_ENDIAN__ 3412 +#endif +#ifndef __DEC128_MIN_EXP__ +#define __DEC128_MIN_EXP__ (-6142) +#endif +#ifndef __INT_FAST32_TYPE__ +#define __INT_FAST32_TYPE__ long int +#endif +#ifndef __UINT_LEAST16_TYPE__ +#define __UINT_LEAST16_TYPE__ short unsigned int +#endif +#ifndef unix +#define unix 1 +#endif +#ifndef __INT16_MAX__ +#define __INT16_MAX__ 0x7fff +#endif +#ifndef __cpp_rtti +#define __cpp_rtti 199711 +#endif +#ifndef __SIZE_TYPE__ +#define __SIZE_TYPE__ long unsigned int +#endif +#ifndef __UINT64_MAX__ +#define __UINT64_MAX__ 0xffffffffffffffffUL +#endif +#ifndef __INT8_TYPE__ +#define __INT8_TYPE__ signed char +#endif +#ifndef __cpp_digit_separators +#define __cpp_digit_separators 201309 +#endif +#ifndef __ELF__ +#define __ELF__ 1 +#endif +#ifndef __GCC_ASM_FLAG_OUTPUTS__ +#define __GCC_ASM_FLAG_OUTPUTS__ 1 +#endif +#ifndef __FLT_RADIX__ +#define __FLT_RADIX__ 2 +#endif +#ifndef __INT_LEAST16_TYPE__ +#define __INT_LEAST16_TYPE__ short int +#endif +#ifndef __LDBL_EPSILON__ +#define __LDBL_EPSILON__ 1.08420217248550443401e-19L +#endif +#ifndef __GLIBCXX_BITSIZE_INT_N_0 +#define __GLIBCXX_BITSIZE_INT_N_0 128 +#endif +#ifndef __k8 +#define __k8 1 +#endif +#ifndef __SIG_ATOMIC_MAX__ +#define __SIG_ATOMIC_MAX__ 0x7fffffff +#endif +#ifndef __GCC_ATOMIC_WCHAR_T_LOCK_FREE +#define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 2 +#endif +#ifndef __cpp_sized_deallocation +#define __cpp_sized_deallocation 201309 +#endif +#ifndef __SIZEOF_PTRDIFF_T__ +#define __SIZEOF_PTRDIFF_T__ 8 +#endif +#ifndef __x86_64__ +#define __x86_64__ 1 +#endif +#ifndef __DEC32_SUBNORMAL_MIN__ +#define __DEC32_SUBNORMAL_MIN__ 0.000001E-95DF +#endif +#ifndef __INT_FAST16_MAX__ +#define __INT_FAST16_MAX__ 0x7fffffffffffffffL +#endif +#ifndef __UINT_FAST32_MAX__ +#define __UINT_FAST32_MAX__ 0xffffffffffffffffUL +#endif +#ifndef __UINT_LEAST64_TYPE__ +#define __UINT_LEAST64_TYPE__ long unsigned int +#endif +#ifndef __FLT_HAS_QUIET_NAN__ +#define __FLT_HAS_QUIET_NAN__ 1 +#endif +#ifndef __FLT_MAX_10_EXP__ +#define __FLT_MAX_10_EXP__ 38 +#endif +#ifndef __LONG_MAX__ +#define __LONG_MAX__ 0x7fffffffffffffffL +#endif +#ifndef __DEC128_SUBNORMAL_MIN__ +#define __DEC128_SUBNORMAL_MIN__ 0.000000000000000000000000000000001E-6143DL +#endif +#ifndef __FLT_HAS_INFINITY__ +#define __FLT_HAS_INFINITY__ 1 +#endif +#ifndef __cpp_unicode_literals +#define __cpp_unicode_literals 200710 +#endif +#ifndef __UINT_FAST16_TYPE__ +#define __UINT_FAST16_TYPE__ long unsigned int +#endif +#ifndef __DEC64_MAX__ +#define __DEC64_MAX__ 9.999999999999999E384DD +#endif +#ifndef __CHAR16_TYPE__ +#define __CHAR16_TYPE__ short unsigned int +#endif +#ifndef __PRAGMA_REDEFINE_EXTNAME +#define __PRAGMA_REDEFINE_EXTNAME 1 +#endif +#ifndef __SEG_FS +#define __SEG_FS 1 +#endif +#ifndef __INT_LEAST16_MAX__ +#define __INT_LEAST16_MAX__ 0x7fff +#endif +#ifndef __DEC64_MANT_DIG__ +#define __DEC64_MANT_DIG__ 16 +#endif +#ifndef __UINT_LEAST32_MAX__ +#define __UINT_LEAST32_MAX__ 0xffffffffU +#endif +#ifndef __SEG_GS +#define __SEG_GS 1 +#endif +#ifndef __GCC_ATOMIC_LONG_LOCK_FREE +#define __GCC_ATOMIC_LONG_LOCK_FREE 2 +#endif +#ifndef __INT_LEAST64_TYPE__ +#define __INT_LEAST64_TYPE__ long int +#endif +#ifndef __INT16_TYPE__ +#define __INT16_TYPE__ short int +#endif +#ifndef __INT_LEAST8_TYPE__ +#define __INT_LEAST8_TYPE__ signed char +#endif +#ifndef __DEC32_MAX_EXP__ +#define __DEC32_MAX_EXP__ 97 +#endif +#ifndef __INT_FAST8_MAX__ +#define __INT_FAST8_MAX__ 0x7f +#endif +#ifndef __INTPTR_MAX__ +#define __INTPTR_MAX__ 0x7fffffffffffffffL +#endif +#ifndef linux +#define linux 1 +#endif +#ifndef __cpp_range_based_for +#define __cpp_range_based_for 200907 +#endif +#ifndef __SSE2__ +#define __SSE2__ 1 +#endif +#ifndef __EXCEPTIONS +#define __EXCEPTIONS 1 +#endif +#ifndef __LDBL_MANT_DIG__ +#define __LDBL_MANT_DIG__ 64 +#endif +#ifndef __DBL_HAS_QUIET_NAN__ +#define __DBL_HAS_QUIET_NAN__ 1 +#endif +#ifndef __SIG_ATOMIC_MIN__ +#define __SIG_ATOMIC_MIN__ (-__SIG_ATOMIC_MAX__ - 1) +#endif +#ifndef __code_model_small__ +#define __code_model_small__ 1 +#endif +#ifndef __cpp_return_type_deduction +#define __cpp_return_type_deduction 201304 +#endif +#ifndef __k8__ +#define __k8__ 1 +#endif +#ifndef __INTPTR_TYPE__ +#define __INTPTR_TYPE__ long int +#endif +#ifndef __UINT16_TYPE__ +#define __UINT16_TYPE__ short unsigned int +#endif +#ifndef __WCHAR_TYPE__ +#define __WCHAR_TYPE__ int +#endif +#ifndef __SIZEOF_FLOAT__ +#define __SIZEOF_FLOAT__ 4 +#endif +#ifndef __pic__ +#define __pic__ 2 +#endif +#ifndef __UINTPTR_MAX__ +#define __UINTPTR_MAX__ 0xffffffffffffffffUL +#endif +#ifndef __DEC64_MIN_EXP__ +#define __DEC64_MIN_EXP__ (-382) +#endif +#ifndef __cpp_decltype +#define __cpp_decltype 200707 +#endif +#ifndef __INT_FAST64_MAX__ +#define __INT_FAST64_MAX__ 0x7fffffffffffffffL +#endif +#ifndef __GCC_ATOMIC_TEST_AND_SET_TRUEVAL +#define __GCC_ATOMIC_TEST_AND_SET_TRUEVAL 1 +#endif +#ifndef __FLT_DIG__ +#define __FLT_DIG__ 6 +#endif +#ifndef __UINT_FAST64_TYPE__ +#define __UINT_FAST64_TYPE__ long unsigned int +#endif +#ifndef __INT_MAX__ +#define __INT_MAX__ 0x7fffffff +#endif +#ifndef __amd64__ +#define __amd64__ 1 +#endif +#ifndef __INT64_TYPE__ +#define __INT64_TYPE__ long int +#endif +#ifndef __FLT_MAX_EXP__ +#define __FLT_MAX_EXP__ 128 +#endif +#ifndef __ORDER_BIG_ENDIAN__ +#define __ORDER_BIG_ENDIAN__ 4321 +#endif +#ifndef __DBL_MANT_DIG__ +#define __DBL_MANT_DIG__ 53 +#endif +#ifndef __cpp_inheriting_constructors +#define __cpp_inheriting_constructors 200802 +#endif +#ifndef __SIZEOF_FLOAT128__ +#define __SIZEOF_FLOAT128__ 16 +#endif +#ifndef __INT_LEAST64_MAX__ +#define __INT_LEAST64_MAX__ 0x7fffffffffffffffL +#endif +#ifndef __DEC64_MIN__ +#define __DEC64_MIN__ 1E-383DD +#endif +#ifndef __WINT_TYPE__ +#define __WINT_TYPE__ unsigned int +#endif +#ifndef __UINT_LEAST32_TYPE__ +#define __UINT_LEAST32_TYPE__ unsigned int +#endif +#ifndef __SIZEOF_SHORT__ +#define __SIZEOF_SHORT__ 2 +#endif +#ifndef __SSE__ +#define __SSE__ 1 +#endif +#ifndef __LDBL_MIN_EXP__ +#define __LDBL_MIN_EXP__ (-16381) +#endif +#ifndef __INT_LEAST8_MAX__ +#define __INT_LEAST8_MAX__ 0x7f +#endif +#ifndef __SIZEOF_INT128__ +#define __SIZEOF_INT128__ 16 +#endif +#ifndef __LDBL_MAX_10_EXP__ +#define __LDBL_MAX_10_EXP__ 4932 +#endif +#ifndef __ATOMIC_RELAXED +#define __ATOMIC_RELAXED 0 +#endif +#ifndef __DBL_EPSILON__ +#define __DBL_EPSILON__ double(2.22044604925031308085e-16L) +#endif +#ifndef _LP64 +#define _LP64 1 +#endif +#ifndef __INT_LEAST32_TYPE__ +#define __INT_LEAST32_TYPE__ int +#endif +#ifndef __SIZEOF_WCHAR_T__ +#define __SIZEOF_WCHAR_T__ 4 +#endif +#ifndef __UINT64_TYPE__ +#define __UINT64_TYPE__ long unsigned int +#endif +#ifndef __INT_FAST8_TYPE__ +#define __INT_FAST8_TYPE__ signed char +#endif +#ifndef __GNUC_STDC_INLINE__ +#define __GNUC_STDC_INLINE__ 1 +#endif +#ifndef __DBL_DECIMAL_DIG__ +#define __DBL_DECIMAL_DIG__ 17 +#endif +#ifndef __STDC_UTF_32__ +#define __STDC_UTF_32__ 1 +#endif +#ifndef __FXSR__ +#define __FXSR__ 1 +#endif +#ifndef __DEC_EVAL_METHOD__ +#define __DEC_EVAL_METHOD__ 2 +#endif +#ifndef __cpp_runtime_arrays +#define __cpp_runtime_arrays 198712 +#endif +#ifndef __INTMAX_MAX__ +#define __INTMAX_MAX__ 0x7fffffffffffffffL +#endif +#ifndef __cpp_alias_templates +#define __cpp_alias_templates 200704 +#endif +#ifndef __BYTE_ORDER__ +#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__ +#endif +#ifndef __FLT_DENORM_MIN__ +#define __FLT_DENORM_MIN__ 1.40129846432481707092e-45F +#endif +#ifndef __INT8_MAX__ +#define __INT8_MAX__ 0x7f +#endif +#ifndef __PIC__ +#define __PIC__ 2 +#endif +#ifndef __UINT_FAST32_TYPE__ +#define __UINT_FAST32_TYPE__ long unsigned int +#endif +#ifndef __CHAR32_TYPE__ +#define __CHAR32_TYPE__ unsigned int +#endif +#ifndef __FLT_MAX__ +#define __FLT_MAX__ 3.40282346638528859812e+38F +#endif +#ifndef __cpp_constexpr +#define __cpp_constexpr 201304 +#endif +#ifndef __INT32_TYPE__ +#define __INT32_TYPE__ int +#endif +#ifndef __SIZEOF_DOUBLE__ +#define __SIZEOF_DOUBLE__ 8 +#endif +#ifndef __cpp_exceptions +#define __cpp_exceptions 199711 +#endif +#ifndef __INTMAX_TYPE__ +#define __INTMAX_TYPE__ long int +#endif +#ifndef __DEC128_MAX_EXP__ +#define __DEC128_MAX_EXP__ 6145 +#endif +#ifndef __ATOMIC_CONSUME +#define __ATOMIC_CONSUME 1 +#endif +#ifndef __GNUC_MINOR__ +#define __GNUC_MINOR__ 3 +#endif +#ifndef __GLIBCXX_TYPE_INT_N_0 +#define __GLIBCXX_TYPE_INT_N_0 __int128 +#endif +#ifndef __UINTMAX_MAX__ +#define __UINTMAX_MAX__ 0xffffffffffffffffUL +#endif +#ifndef __DEC32_MANT_DIG__ +#define __DEC32_MANT_DIG__ 7 +#endif +#ifndef __DBL_MAX_10_EXP__ +#define __DBL_MAX_10_EXP__ 308 +#endif +#ifndef __LDBL_DENORM_MIN__ +#define __LDBL_DENORM_MIN__ 3.64519953188247460253e-4951L +#endif +#ifndef __cpp_generic_lambdas +#define __cpp_generic_lambdas 201304 +#endif +#ifndef __STDC__ +#define __STDC__ 1 +#endif +#ifndef __PTRDIFF_TYPE__ +#define __PTRDIFF_TYPE__ long int +#endif +#ifndef __ATOMIC_SEQ_CST +#define __ATOMIC_SEQ_CST 5 +#endif +#ifndef __UINT32_TYPE__ +#define __UINT32_TYPE__ unsigned int +#endif +#ifndef __UINTPTR_TYPE__ +#define __UINTPTR_TYPE__ long unsigned int +#endif +#ifndef __DEC64_SUBNORMAL_MIN__ +#define __DEC64_SUBNORMAL_MIN__ 0.000000000000001E-383DD +#endif +#ifndef __DEC128_MANT_DIG__ +#define __DEC128_MANT_DIG__ 34 +#endif +#ifndef __LDBL_MIN_10_EXP__ +#define __LDBL_MIN_10_EXP__ (-4931) +#endif +#ifndef __SSE_MATH__ +#define __SSE_MATH__ 1 +#endif +#ifndef __SIZEOF_LONG_LONG__ +#define __SIZEOF_LONG_LONG__ 8 +#endif +#ifndef __cpp_user_defined_literals +#define __cpp_user_defined_literals 200809 +#endif +#ifndef __GCC_ATOMIC_LLONG_LOCK_FREE +#define __GCC_ATOMIC_LLONG_LOCK_FREE 2 +#endif +#ifndef __LDBL_DIG__ +#define __LDBL_DIG__ 18 +#endif +#ifndef __FLT_DECIMAL_DIG__ +#define __FLT_DECIMAL_DIG__ 9 +#endif +#ifndef __UINT_FAST16_MAX__ +#define __UINT_FAST16_MAX__ 0xffffffffffffffffUL +#endif +#ifndef __FLT_MIN_10_EXP__ +#define __FLT_MIN_10_EXP__ (-37) +#endif +#ifndef __GCC_ATOMIC_SHORT_LOCK_FREE +#define __GCC_ATOMIC_SHORT_LOCK_FREE 2 +#endif +#ifndef __UINT_FAST8_TYPE__ +#define __UINT_FAST8_TYPE__ unsigned char +#endif +#ifndef _GNU_SOURCE +#define _GNU_SOURCE 1 +#endif +#ifndef __cpp_init_captures +#define __cpp_init_captures 201304 +#endif +#ifndef __ATOMIC_ACQ_REL +#define __ATOMIC_ACQ_REL 4 +#endif +#ifndef __ATOMIC_RELEASE +#define __ATOMIC_RELEASE 3 +#endif +#ifndef NDEBUG +#define NDEBUG 1 +#endif +#ifndef RELEASE +#define RELEASE 1 +#endif +#endif + +// --- Include directories begin --- // +///usr/include/c++/6 +///usr/include/x86_64-linux-gnu/c++/6 +///usr/include/c++/6/backward +///usr/lib/gcc/x86_64-linux-gnu/6/include +///usr/local/include +///usr/lib/gcc/x86_64-linux-gnu/6/include-fixed +///usr/include/x86_64-linux-gnu +///usr/include +// --- Include directories end --- // + + +// --- Library directories begin --- // +///usr/lib/gcc/x86_64-linux-gnu/6/ +///usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/ +///usr/lib/gcc/x86_64-linux-gnu/6/../../../../lib/ +///lib/x86_64-linux-gnu/ +///lib/../lib/ +///usr/lib/x86_64-linux-gnu/ +///usr/lib/../lib/ +///usr/lib/gcc/x86_64-linux-gnu/6/../../../ +///lib/ +///usr/lib/ +// --- Library directories begin --- // + +#pragma clang diagnostic pop diff --git a/examples/knx-linux/knx-linux-Debug.vgdbsettings b/examples/knx-linux/knx-linux-Debug.vgdbsettings new file mode 100644 index 0000000..5c17819 --- /dev/null +++ b/examples/knx-linux/knx-linux-Debug.vgdbsettings @@ -0,0 +1,179 @@ + + + Debug + + + + RemoteUnix + + + Immerlund + SSH + tkunze + + + false + + Suzail + SSH + tkunze + + $(ProjectDir)\..\.. + /home/tkunze/vgdb/knx-linux + + *.cpp + *.h + *.hpp + *.c + *.cc + *.cxx + *.mak + Makefile + *.txt + *.cmake + CMakeLists.txt + *.cmake + + false + true + + true + true + + Outgoing + false + Always + + + false + false + false + false + false + $(ProjectDir) + + + + com.sysprogs.toolchain.default-gcc + + 0 + + + examples/knx-linux + DEBUG + Debug + knx-linux + + false + + BuildMachine + BuiltinShortcut + + $(ToolchainMake) + $(ToolchainMakeArgs) + $(BuildDir) + + + + false + + BuildMachine + BuiltinShortcut + + $(ToolchainCMake) + $(BuildDir) + + + false + false + false + false + RemoveBuildDirectory + + + + + + + + + + + + + Default + + + + true + + + + + True + -DMEDIUM_TYPE=5 + + true + true + + Silent + true + true + true + + true + ..\.clang-format + ClangFormat + + + false + + + + + + + + + false + false + false + false + false + false + false + false + false + + false + false + false + false + false + false + true + false + None + false + false + main + true + false + false + false + 0 + + + $(TargetPath) + 2000 + + + false + Local + false + false + Auto + true + false + + \ No newline at end of file diff --git a/examples/knx-linux/knx-linux.vcxproj b/examples/knx-linux/knx-linux.vcxproj new file mode 100644 index 0000000..cdc925d --- /dev/null +++ b/examples/knx-linux/knx-linux.vcxproj @@ -0,0 +1,188 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + + 16.0 + {456D87B3-1DFE-4724-BDEF-17E0FDB55A61} + + + + Makefile + true + v142 + + + Makefile + false + v142 + + + com.sysprogs.toolchain.default-gcc + + + + + + + + + + + + + + + + + + $(LOCALAPPDATA)\VisualGDB\RemoteSourceCache\Suzail\0000\include\c++\6;$(LOCALAPPDATA)\VisualGDB\RemoteSourceCache\Suzail\0000\include\x86_64-linux-gnu\c++\6;$(LOCALAPPDATA)\VisualGDB\RemoteSourceCache\Suzail\0000\include\c++\6\backward;$(LOCALAPPDATA)\VisualGDB\RemoteSourceCache\Suzail\0003\include;$(LOCALAPPDATA)\VisualGDB\RemoteSourceCache\Suzail\0005\include;$(LOCALAPPDATA)\VisualGDB\RemoteSourceCache\Suzail\0004\include-fixed;$(LOCALAPPDATA)\VisualGDB\RemoteSourceCache\Suzail\0000\include\x86_64-linux-gnu;$(LOCALAPPDATA)\VisualGDB\RemoteSourceCache\Suzail\0000\include;..\src;$(NMakeIncludeSearchPath) + $(ProjectDir)\gcc_Debug.h;$(VISUALGDB_DIR)\gcc_compat.h;$(NMakeForcedIncludes) + "$(VISUALGDB_DIR)\VisualGDB.exe" /build "$(ProjectPath)" "/solution:$(SolutionPath)" "/config:$(Configuration)" "/platform:$(Platform)" + "$(VISUALGDB_DIR)\VisualGDB.exe" /clean "$(ProjectPath)" "/solution:$(SolutionPath)" "/config:$(Configuration)" "/platform:$(Platform)" + "$(VISUALGDB_DIR)\VisualGDB.exe" /rebuild "$(ProjectPath)" "/solution:$(SolutionPath)" "/config:$(Configuration)" "/platform:$(Platform)" + $(ProjectDir)knx-linux-Debug.vgdbsettings + + + + __VisualGDB_CFG_Debug;$(NMakePreprocessorDefinitions) + + + $(LOCALAPPDATA)\VisualGDB\RemoteSourceCache\Suzail\0000\include\c++\6;$(LOCALAPPDATA)\VisualGDB\RemoteSourceCache\Suzail\0000\include\x86_64-linux-gnu\c++\6;$(LOCALAPPDATA)\VisualGDB\RemoteSourceCache\Suzail\0000\include\c++\6\backward;$(LOCALAPPDATA)\VisualGDB\RemoteSourceCache\Suzail\0003\include;$(LOCALAPPDATA)\VisualGDB\RemoteSourceCache\Suzail\0005\include;$(LOCALAPPDATA)\VisualGDB\RemoteSourceCache\Suzail\0004\include-fixed;$(LOCALAPPDATA)\VisualGDB\RemoteSourceCache\Suzail\0000\include\x86_64-linux-gnu;$(LOCALAPPDATA)\VisualGDB\RemoteSourceCache\Suzail\0000\include;$(NMakeIncludeSearchPath) + $(ProjectDir)\gcc_Release.h;$(VISUALGDB_DIR)\gcc_compat.h;$(NMakeForcedIncludes) + __VisualGDB_CFG_Release;$(NMakePreprocessorDefinitions) + "$(VISUALGDB_DIR)\VisualGDB.exe" /build "$(ProjectPath)" "/solution:$(SolutionPath)" "/config:$(Configuration)" "/platform:$(Platform)" + "$(VISUALGDB_DIR)\VisualGDB.exe" /clean "$(ProjectPath)" "/solution:$(SolutionPath)" "/config:$(Configuration)" "/platform:$(Platform)" + "$(VISUALGDB_DIR)\VisualGDB.exe" /rebuild "$(ProjectPath)" "/solution:$(SolutionPath)" "/config:$(Configuration)" "/platform:$(Platform)" + $(ProjectDir)knx-linux-Release.vgdbsettings + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/examples/knx-linux/knx-linux.vcxproj.filters b/examples/knx-linux/knx-linux.vcxproj.filters new file mode 100644 index 0000000..6b44be3 --- /dev/null +++ b/examples/knx-linux/knx-linux.vcxproj.filters @@ -0,0 +1,353 @@ + + + + + {29de078d-e84a-4e6d-92cb-26384b285546} + cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx + + + {d598f99b-b8fc-4ed9-8a7e-0a047e95dd6a} + h;hpp;hxx;hm;inl;inc;xsd + + + {ca59d480-df76-48f4-984e-06d3c358cbc3} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav + + + {b4d51fcc-4baa-41f7-a703-7beb0174c220} + + + {3dbcfef7-ce75-49d5-bb03-d72ec2dd20bd} + + + {726bfac3-c98a-4508-9595-11dab7ffc9d0} + + + + + Source files + + + VisualGDB settings + + + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files + + + Header files + + + Header files + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + Header files\knx + + + + + Source files + + + Source files + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + Source files\knx + + + \ No newline at end of file diff --git a/examples/knx-linux/main.cpp b/examples/knx-linux/main.cpp new file mode 100644 index 0000000..f835e0e --- /dev/null +++ b/examples/knx-linux/main.cpp @@ -0,0 +1,166 @@ +#include "knx_facade.h" + +#include "knx/bau57B0.h" +#include "knx/bau27B0.h" +#include "knx/bau07B0.h" + +#include "knx/group_object_table_object.h" +#include "knx/bits.h" +#include +#include +#include +#include +#include +#include +#include + +#include "fdsk.h" + +volatile sig_atomic_t loopActive = 1; +void signalHandler(int sig) +{ + (void)sig; + + // can be called asynchronously + loopActive = 0; +} + +bool sendHidReport(uint8_t* data, uint16_t length) +{ + return false; +} +bool isSendHidReportPossible() +{ + return false; +} +#if MEDIUM_TYPE == 5 +KnxFacade knx; +#elif MEDIUM_TYPE == 2 +KnxFacade knx; +#else +#error Only MEDIUM_TYPE IP and RF supported +#endif + +long lastsend = 0; + +#define CURR knx.getGroupObject(1) +#define MAX knx.getGroupObject(2) +#define MIN knx.getGroupObject(3) +#define RESET knx.getGroupObject(4) + +void measureTemp() +{ + long now = millis(); + if ((now - lastsend) < 10000) + return; + + lastsend = now; + int r = rand(); + double currentValue = (r * 1.0) / (RAND_MAX * 1.0); + currentValue *= 100; + currentValue -= 50; + // currentValue *= (670433.28 + 273); + // currentValue -= 273; + println(currentValue); + CURR.value(currentValue); + + double max = MAX.value(); + if (currentValue > max) + MAX.value(currentValue); + + if (currentValue < (double)MIN.value()) + MIN.value(currentValue); +} + +void resetCallback(GroupObject& go) +{ + if (go.value()) + { + MAX.valueNoSend(-273.0); + MIN.valueNoSend(670433.28); + } +} + +void appLoop() +{ + if (!knx.configured()) + return; + + measureTemp(); +} + +void setup() +{ + srand((unsigned int)time(NULL)); + knx.readMemory(); + + if (knx.induvidualAddress() == 0) + knx.progMode(true); + + if (knx.configured()) + { + CURR.dataPointType(Dpt(9, 1)); + MIN.dataPointType(Dpt(9, 1)); + MIN.value(670433.28); + MAX.dataPointType(Dpt(9, 1)); + MAX.valueNoSend(-273.0); + RESET.dataPointType(Dpt(1, 15)); + RESET.callback(resetCallback); + printf("Timeout: %d\n", knx.paramWord(0)); + printf("Zykl. senden: %d\n", knx.paramByte(2)); + printf("Min/Max senden: %d\n", knx.paramByte(3)); + printf("Aenderung senden: %d\n", knx.paramByte(4)); + printf("Abgleich %d\n", knx.paramByte(5)); + } + else + println("not configured"); + knx.start(); +} + +int main(int argc, char **argv) +{ + printf("main() start.\n"); + + uint8_t serialNumber[] = { 0x00, 0xFA, 0x01, 0x02, 0x03, 0x04}; + uint8_t key[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F}; + + FdskCalculator calc; + char fdskString[42]; // 6 * 6 chars + 5 dashes + nullbyte = 42 + calc.snprintFdsk(fdskString, sizeof(fdskString), serialNumber, key); + printf("FDSK: %s\n", fdskString); + + // Prevent swapping of this process + struct sched_param sp; + memset(&sp, 0, sizeof(sp)); + sp.sched_priority = sched_get_priority_max(SCHED_FIFO); + sched_setscheduler(0, SCHED_FIFO, &sp); + mlockall(MCL_CURRENT | MCL_FUTURE); + + // Register signals + signal(SIGINT, signalHandler); + signal(SIGTERM, signalHandler); + + knx.platform().cmdLineArgs(argc, argv); + + setup(); + + while (loopActive) + { + knx.loop(); + if(knx.configured()) + appLoop(); + delayMicroseconds(100); + } + + // pinMode() will automatically export GPIO pin in sysfs + // Read or writing the GPIO pin for the first time automatically + // opens the "value" sysfs file to read or write the GPIO pin value. + // The following calls will close the "value" sysfs fiel for the pin + // and unexport the GPIO pin. +#ifdef USE_RF + gpio_unexport(SPI_SS_PIN); + gpio_unexport(GPIO_GDO2_PIN); + gpio_unexport(GPIO_GDO0_PIN); +#endif + printf("main() exit.\n"); +}