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