1 // Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com 2 // 3 // Part of "Nuitka", an optimizing Python compiler that is compatible and 4 // integrates with CPython, but also works on its own. 5 // 6 // Licensed under the Apache License, Version 2.0 (the "License"); 7 // you may not use this file except in compliance with the License. 8 // You may obtain a copy of the License at 9 // 10 // http://www.apache.org/licenses/LICENSE-2.0 11 // 12 // Unless required by applicable law or agreed to in writing, software 13 // distributed under the License is distributed on an "AS IS" BASIS, 14 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 15 // See the License for the specific language governing permissions and 16 // limitations under the License. 17 // 18 /* WARNING, this code is GENERATED. Modify the template HelperOperationBinary.c.j2 instead! */ 19 20 /* This file is included from another C file, help IDEs to still parse it on its own. */ 21 #ifdef __IDE_ONLY__ 22 #include "nuitka/prelude.h" 23 #endif 24 25 /* C helpers for type specialized "+" (ADD) operations */ 26 27 #if PYTHON_VERSION < 0x300 28 /* Code referring to "INT" corresponds to Python2 'int' and "INT" to Python2 'int'. */ 29 extern PyObject *BINARY_OPERATION_ADD_OBJECT_INT_INT(PyObject *operand1, PyObject *operand2); 30 #endif 31 32 #if PYTHON_VERSION < 0x300 33 /* Code referring to "OBJECT" corresponds to any Python object and "INT" to Python2 'int'. */ 34 extern PyObject *BINARY_OPERATION_ADD_OBJECT_OBJECT_INT(PyObject *operand1, PyObject *operand2); 35 #endif 36 37 #if PYTHON_VERSION < 0x300 38 /* Code referring to "INT" corresponds to Python2 'int' and "OBJECT" to any Python object. */ 39 extern PyObject *BINARY_OPERATION_ADD_OBJECT_INT_OBJECT(PyObject *operand1, PyObject *operand2); 40 #endif 41 42 #if PYTHON_VERSION < 0x300 43 /* Code referring to "INT" corresponds to Python2 'int' and "INT" to Python2 'int'. */ 44 extern nuitka_bool BINARY_OPERATION_ADD_NBOOL_INT_INT(PyObject *operand1, PyObject *operand2); 45 #endif 46 47 #if PYTHON_VERSION < 0x300 48 /* Code referring to "OBJECT" corresponds to any Python object and "INT" to Python2 'int'. */ 49 extern nuitka_bool BINARY_OPERATION_ADD_NBOOL_OBJECT_INT(PyObject *operand1, PyObject *operand2); 50 #endif 51 52 #if PYTHON_VERSION < 0x300 53 /* Code referring to "INT" corresponds to Python2 'int' and "OBJECT" to any Python object. */ 54 extern nuitka_bool BINARY_OPERATION_ADD_NBOOL_INT_OBJECT(PyObject *operand1, PyObject *operand2); 55 #endif 56 57 /* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "LONG" to Python2 'long', Python3 'int'. */ 58 extern PyObject *BINARY_OPERATION_ADD_OBJECT_LONG_LONG(PyObject *operand1, PyObject *operand2); 59 60 /* Code referring to "OBJECT" corresponds to any Python object and "LONG" to Python2 'long', Python3 'int'. */ 61 extern PyObject *BINARY_OPERATION_ADD_OBJECT_OBJECT_LONG(PyObject *operand1, PyObject *operand2); 62 63 /* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "OBJECT" to any Python object. */ 64 extern PyObject *BINARY_OPERATION_ADD_OBJECT_LONG_OBJECT(PyObject *operand1, PyObject *operand2); 65 66 /* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "LONG" to Python2 'long', Python3 'int'. */ 67 extern nuitka_bool BINARY_OPERATION_ADD_NBOOL_LONG_LONG(PyObject *operand1, PyObject *operand2); 68 69 /* Code referring to "OBJECT" corresponds to any Python object and "LONG" to Python2 'long', Python3 'int'. */ 70 extern nuitka_bool BINARY_OPERATION_ADD_NBOOL_OBJECT_LONG(PyObject *operand1, PyObject *operand2); 71 72 /* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "OBJECT" to any Python object. */ 73 extern nuitka_bool BINARY_OPERATION_ADD_NBOOL_LONG_OBJECT(PyObject *operand1, PyObject *operand2); 74 75 /* Code referring to "FLOAT" corresponds to Python 'float' and "FLOAT" to Python 'float'. */ 76 extern PyObject *BINARY_OPERATION_ADD_OBJECT_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2); 77 78 /* Code referring to "OBJECT" corresponds to any Python object and "FLOAT" to Python 'float'. */ 79 extern PyObject *BINARY_OPERATION_ADD_OBJECT_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2); 80 81 /* Code referring to "FLOAT" corresponds to Python 'float' and "OBJECT" to any Python object. */ 82 extern PyObject *BINARY_OPERATION_ADD_OBJECT_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2); 83 84 /* Code referring to "FLOAT" corresponds to Python 'float' and "FLOAT" to Python 'float'. */ 85 extern nuitka_bool BINARY_OPERATION_ADD_NBOOL_FLOAT_FLOAT(PyObject *operand1, PyObject *operand2); 86 87 /* Code referring to "OBJECT" corresponds to any Python object and "FLOAT" to Python 'float'. */ 88 extern nuitka_bool BINARY_OPERATION_ADD_NBOOL_OBJECT_FLOAT(PyObject *operand1, PyObject *operand2); 89 90 /* Code referring to "FLOAT" corresponds to Python 'float' and "OBJECT" to any Python object. */ 91 extern nuitka_bool BINARY_OPERATION_ADD_NBOOL_FLOAT_OBJECT(PyObject *operand1, PyObject *operand2); 92 93 #if PYTHON_VERSION < 0x300 94 /* Code referring to "STR" corresponds to Python2 'str' and "STR" to Python2 'str'. */ 95 extern PyObject *BINARY_OPERATION_ADD_OBJECT_STR_STR(PyObject *operand1, PyObject *operand2); 96 #endif 97 98 #if PYTHON_VERSION < 0x300 99 /* Code referring to "OBJECT" corresponds to any Python object and "STR" to Python2 'str'. */ 100 extern PyObject *BINARY_OPERATION_ADD_OBJECT_OBJECT_STR(PyObject *operand1, PyObject *operand2); 101 #endif 102 103 #if PYTHON_VERSION < 0x300 104 /* Code referring to "STR" corresponds to Python2 'str' and "OBJECT" to any Python object. */ 105 extern PyObject *BINARY_OPERATION_ADD_OBJECT_STR_OBJECT(PyObject *operand1, PyObject *operand2); 106 #endif 107 108 /* Code referring to "UNICODE" corresponds to Python2 'unicode', Python3 'str' and "UNICODE" to Python2 'unicode', 109 * Python3 'str'. */ 110 extern PyObject *BINARY_OPERATION_ADD_OBJECT_UNICODE_UNICODE(PyObject *operand1, PyObject *operand2); 111 112 /* Code referring to "OBJECT" corresponds to any Python object and "UNICODE" to Python2 'unicode', Python3 'str'. */ 113 extern PyObject *BINARY_OPERATION_ADD_OBJECT_OBJECT_UNICODE(PyObject *operand1, PyObject *operand2); 114 115 /* Code referring to "UNICODE" corresponds to Python2 'unicode', Python3 'str' and "OBJECT" to any Python object. */ 116 extern PyObject *BINARY_OPERATION_ADD_OBJECT_UNICODE_OBJECT(PyObject *operand1, PyObject *operand2); 117 118 #if PYTHON_VERSION >= 0x300 119 /* Code referring to "BYTES" corresponds to Python3 'bytes' and "BYTES" to Python3 'bytes'. */ 120 extern PyObject *BINARY_OPERATION_ADD_OBJECT_BYTES_BYTES(PyObject *operand1, PyObject *operand2); 121 #endif 122 123 #if PYTHON_VERSION >= 0x300 124 /* Code referring to "OBJECT" corresponds to any Python object and "BYTES" to Python3 'bytes'. */ 125 extern PyObject *BINARY_OPERATION_ADD_OBJECT_OBJECT_BYTES(PyObject *operand1, PyObject *operand2); 126 #endif 127 128 #if PYTHON_VERSION >= 0x300 129 /* Code referring to "BYTES" corresponds to Python3 'bytes' and "OBJECT" to any Python object. */ 130 extern PyObject *BINARY_OPERATION_ADD_OBJECT_BYTES_OBJECT(PyObject *operand1, PyObject *operand2); 131 #endif 132 133 /* Code referring to "TUPLE" corresponds to Python 'tuple' and "TUPLE" to Python 'tuple'. */ 134 extern PyObject *BINARY_OPERATION_ADD_OBJECT_TUPLE_TUPLE(PyObject *operand1, PyObject *operand2); 135 136 /* Code referring to "OBJECT" corresponds to any Python object and "TUPLE" to Python 'tuple'. */ 137 extern PyObject *BINARY_OPERATION_ADD_OBJECT_OBJECT_TUPLE(PyObject *operand1, PyObject *operand2); 138 139 /* Code referring to "TUPLE" corresponds to Python 'tuple' and "OBJECT" to any Python object. */ 140 extern PyObject *BINARY_OPERATION_ADD_OBJECT_TUPLE_OBJECT(PyObject *operand1, PyObject *operand2); 141 142 /* Code referring to "LIST" corresponds to Python 'list' and "LIST" to Python 'list'. */ 143 extern PyObject *BINARY_OPERATION_ADD_OBJECT_LIST_LIST(PyObject *operand1, PyObject *operand2); 144 145 /* Code referring to "OBJECT" corresponds to any Python object and "LIST" to Python 'list'. */ 146 extern PyObject *BINARY_OPERATION_ADD_OBJECT_OBJECT_LIST(PyObject *operand1, PyObject *operand2); 147 148 /* Code referring to "LIST" corresponds to Python 'list' and "OBJECT" to any Python object. */ 149 extern PyObject *BINARY_OPERATION_ADD_OBJECT_LIST_OBJECT(PyObject *operand1, PyObject *operand2); 150 151 /* Code referring to "LIST" corresponds to Python 'list' and "LIST" to Python 'list'. */ 152 extern nuitka_bool BINARY_OPERATION_ADD_NBOOL_LIST_LIST(PyObject *operand1, PyObject *operand2); 153 154 /* Code referring to "OBJECT" corresponds to any Python object and "LIST" to Python 'list'. */ 155 extern nuitka_bool BINARY_OPERATION_ADD_NBOOL_OBJECT_LIST(PyObject *operand1, PyObject *operand2); 156 157 /* Code referring to "LIST" corresponds to Python 'list' and "OBJECT" to any Python object. */ 158 extern nuitka_bool BINARY_OPERATION_ADD_NBOOL_LIST_OBJECT(PyObject *operand1, PyObject *operand2); 159 160 #if PYTHON_VERSION < 0x300 161 /* Code referring to "INT" corresponds to Python2 'int' and "LONG" to Python2 'long', Python3 'int'. */ 162 extern PyObject *BINARY_OPERATION_ADD_OBJECT_INT_LONG(PyObject *operand1, PyObject *operand2); 163 #endif 164 165 #if PYTHON_VERSION < 0x300 166 /* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "INT" to Python2 'int'. */ 167 extern PyObject *BINARY_OPERATION_ADD_OBJECT_LONG_INT(PyObject *operand1, PyObject *operand2); 168 #endif 169 170 #if PYTHON_VERSION < 0x300 171 /* Code referring to "INT" corresponds to Python2 'int' and "LONG" to Python2 'long', Python3 'int'. */ 172 extern nuitka_bool BINARY_OPERATION_ADD_NBOOL_INT_LONG(PyObject *operand1, PyObject *operand2); 173 #endif 174 175 #if PYTHON_VERSION < 0x300 176 /* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "INT" to Python2 'int'. */ 177 extern nuitka_bool BINARY_OPERATION_ADD_NBOOL_LONG_INT(PyObject *operand1, PyObject *operand2); 178 #endif 179 180 #if PYTHON_VERSION < 0x300 181 /* Code referring to "INT" corresponds to Python2 'int' and "FLOAT" to Python 'float'. */ 182 extern PyObject *BINARY_OPERATION_ADD_OBJECT_INT_FLOAT(PyObject *operand1, PyObject *operand2); 183 #endif 184 185 #if PYTHON_VERSION < 0x300 186 /* Code referring to "FLOAT" corresponds to Python 'float' and "INT" to Python2 'int'. */ 187 extern PyObject *BINARY_OPERATION_ADD_OBJECT_FLOAT_INT(PyObject *operand1, PyObject *operand2); 188 #endif 189 190 #if PYTHON_VERSION < 0x300 191 /* Code referring to "INT" corresponds to Python2 'int' and "FLOAT" to Python 'float'. */ 192 extern nuitka_bool BINARY_OPERATION_ADD_NBOOL_INT_FLOAT(PyObject *operand1, PyObject *operand2); 193 #endif 194 195 #if PYTHON_VERSION < 0x300 196 /* Code referring to "FLOAT" corresponds to Python 'float' and "INT" to Python2 'int'. */ 197 extern nuitka_bool BINARY_OPERATION_ADD_NBOOL_FLOAT_INT(PyObject *operand1, PyObject *operand2); 198 #endif 199 200 /* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "FLOAT" to Python 'float'. */ 201 extern PyObject *BINARY_OPERATION_ADD_OBJECT_LONG_FLOAT(PyObject *operand1, PyObject *operand2); 202 203 /* Code referring to "FLOAT" corresponds to Python 'float' and "LONG" to Python2 'long', Python3 'int'. */ 204 extern PyObject *BINARY_OPERATION_ADD_OBJECT_FLOAT_LONG(PyObject *operand1, PyObject *operand2); 205 206 /* Code referring to "LONG" corresponds to Python2 'long', Python3 'int' and "FLOAT" to Python 'float'. */ 207 extern nuitka_bool BINARY_OPERATION_ADD_NBOOL_LONG_FLOAT(PyObject *operand1, PyObject *operand2); 208 209 /* Code referring to "FLOAT" corresponds to Python 'float' and "LONG" to Python2 'long', Python3 'int'. */ 210 extern nuitka_bool BINARY_OPERATION_ADD_NBOOL_FLOAT_LONG(PyObject *operand1, PyObject *operand2); 211 212 #if PYTHON_VERSION < 0x300 213 /* Code referring to "STR" corresponds to Python2 'str' and "UNICODE" to Python2 'unicode', Python3 'str'. */ 214 extern PyObject *BINARY_OPERATION_ADD_OBJECT_STR_UNICODE(PyObject *operand1, PyObject *operand2); 215 #endif 216 217 #if PYTHON_VERSION < 0x300 218 /* Code referring to "UNICODE" corresponds to Python2 'unicode', Python3 'str' and "STR" to Python2 'str'. */ 219 extern PyObject *BINARY_OPERATION_ADD_OBJECT_UNICODE_STR(PyObject *operand1, PyObject *operand2); 220 #endif 221 222 #if PYTHON_VERSION < 0x300 223 /* Code referring to "STR" corresponds to Python2 'str' and "UNICODE" to Python2 'unicode', Python3 'str'. */ 224 extern nuitka_bool BINARY_OPERATION_ADD_NBOOL_STR_UNICODE(PyObject *operand1, PyObject *operand2); 225 #endif 226 227 #if PYTHON_VERSION < 0x300 228 /* Code referring to "UNICODE" corresponds to Python2 'unicode', Python3 'str' and "STR" to Python2 'str'. */ 229 extern nuitka_bool BINARY_OPERATION_ADD_NBOOL_UNICODE_STR(PyObject *operand1, PyObject *operand2); 230 #endif 231 232 /* Code referring to "OBJECT" corresponds to any Python object and "OBJECT" to any Python object. */ 233 extern PyObject *BINARY_OPERATION_ADD_OBJECT_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2); 234 235 /* Code referring to "OBJECT" corresponds to any Python object and "OBJECT" to any Python object. */ 236 extern nuitka_bool BINARY_OPERATION_ADD_NBOOL_OBJECT_OBJECT(PyObject *operand1, PyObject *operand2); 237