Skip to content

Commit 697e4ea

Browse files
committed
[mypyc] Mark librt.vecs as non-experimental
Compile contents without an opt-in flag.
1 parent 1730c95 commit 697e4ea

26 files changed

Lines changed: 14 additions & 91 deletions

mypyc/lib-rt/vecs/librt_vecs.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,6 @@
7474
#include <Python.h>
7575
#include "librt_vecs.h"
7676

77-
#ifdef MYPYC_EXPERIMENTAL
78-
7977
PyTypeObject *LibRTVecs_I64TypeObj;
8078
PyTypeObject *LibRTVecs_I32TypeObj;
8179
PyTypeObject *LibRTVecs_I16TypeObj;
@@ -982,22 +980,17 @@ static VecCapsule Capsule = {
982980
get_vec_type,
983981
};
984982

985-
#endif // MYPYC_EXPERIMENTAL
986-
987983
static PyMethodDef VecsMethods[] = {
988-
#ifdef MYPYC_EXPERIMENTAL
989984
{"append", vec_append, METH_VARARGS, "Append a value to the end of a vec"},
990985
{"remove", vec_remove, METH_VARARGS, "Remove first occurrence of value from a vec"},
991986
{"pop", vec_pop, METH_VARARGS, "Remove and return vec item at index (default last)"},
992987
{"extend", vec_extend, METH_VARARGS, "Extend a vec with items from an iterable"},
993-
#endif
994988
{NULL, NULL, 0, NULL} /* Sentinel */
995989
};
996990

997991
static int
998992
librt_vecs_module_exec(PyObject *m)
999993
{
1000-
#ifdef MYPYC_EXPERIMENTAL
1001994
PyObject *ext = PyImport_ImportModule("mypy_extensions");
1002995
if (ext == NULL) {
1003996
return -1;
@@ -1109,7 +1102,6 @@ librt_vecs_module_exec(PyObject *m)
11091102
}
11101103

11111104
Py_DECREF(ext);
1112-
#endif
11131105
return 0;
11141106
}
11151107

mypyc/lib-rt/vecs/librt_vecs.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@
2020
// ABI version is changed, but see the comment above).
2121
#define LIBRT_VECS_API_VERSION 1
2222

23-
#ifdef MYPYC_EXPERIMENTAL
24-
2523
// Magic (native) integer return value on exception. Caller must also
2624
// use PyErr_Occurred() since this overlaps with valid integer values.
2725
#define MYPYC_INT_ERROR -113
@@ -997,6 +995,4 @@ int Vec_GenericRemove(Py_ssize_t *len, PyObject **items, PyObject *item);
997995
PyObject *Vec_GenericPopWrapper(Py_ssize_t *len, PyObject **items, PyObject *args);
998996
PyObject *Vec_GenericPop(Py_ssize_t *len, PyObject **items, Py_ssize_t index);
999997

1000-
#endif // MYPYC_EXPERIMENTAL
1001-
1002998
#endif // VEC_H_INCL

mypyc/lib-rt/vecs/librt_vecs_api.c

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,5 @@
11
#include "librt_vecs_api.h"
22

3-
#ifndef MYPYC_EXPERIMENTAL
4-
5-
int
6-
import_librt_vecs(void)
7-
{
8-
// All librt.vecs features are experimental for now, so don't set up the API here
9-
return 0;
10-
}
11-
12-
#else
13-
143
VecCapsule *VecApi = NULL;
154
VecI64API VecI64Api = {0};
165
VecI32API VecI32Api = {0};
@@ -60,5 +49,3 @@ import_librt_vecs(void)
6049
VecNestedApi = *VecApi->nested;
6150
return 0;
6251
}
63-
64-
#endif // MYPYC_EXPERIMENTAL

mypyc/lib-rt/vecs/librt_vecs_api.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@
1010
int
1111
import_librt_vecs(void);
1212

13-
#ifdef MYPYC_EXPERIMENTAL
14-
1513
// Global API pointers initialized by import_librt_vecs()
1614
extern VecCapsule *VecApi;
1715
extern VecI64API VecI64Api;
@@ -23,6 +21,4 @@ extern VecBoolAPI VecBoolApi;
2321
extern VecTAPI VecTApi;
2422
extern VecNestedAPI VecNestedApi;
2523

26-
#endif // MYPYC_EXPERIMENTAL
27-
2824
#endif // LIBRT_VECS_API_H

mypyc/lib-rt/vecs/vec_bool.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#ifdef MYPYC_EXPERIMENTAL
21
#define VEC VecBool
32
#define VEC_TYPE VecBoolType
43
#define VEC_OBJECT VecBoolObject
@@ -17,5 +16,3 @@
1716
#define BUFFER_FORMAT "b"
1817

1918
#include "vec_template.c"
20-
21-
#endif // MYPYC_EXPERIMENTAL

mypyc/lib-rt/vecs/vec_float.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#ifdef MYPYC_EXPERIMENTAL
21
#define VEC VecFloat
32
#define VEC_TYPE VecFloatType
43
#define VEC_OBJECT VecFloatObject
@@ -18,5 +17,3 @@
1817
#define BUFFER_FORMAT "d"
1918

2019
#include "vec_template.c"
21-
22-
#endif // MYPYC_EXPERIMENTAL

mypyc/lib-rt/vecs/vec_i16.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#ifdef MYPYC_EXPERIMENTAL
21
#define VEC VecI16
32
#define VEC_TYPE VecI16Type
43
#define VEC_OBJECT VecI16Object
@@ -18,5 +17,3 @@
1817
#define BUFFER_FORMAT "h"
1918

2019
#include "vec_template.c"
21-
22-
#endif // MYPYC_EXPERIMENTAL

mypyc/lib-rt/vecs/vec_i32.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#ifdef MYPYC_EXPERIMENTAL
21
#define VEC VecI32
32
#define VEC_TYPE VecI32Type
43
#define VEC_OBJECT VecI32Object
@@ -18,5 +17,3 @@
1817
#define BUFFER_FORMAT "i"
1918

2019
#include "vec_template.c"
21-
22-
#endif // MYPYC_EXPERIMENTAL

mypyc/lib-rt/vecs/vec_i64.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#ifdef MYPYC_EXPERIMENTAL
21
#define VEC VecI64
32
#define VEC_TYPE VecI64Type
43
#define VEC_OBJECT VecI64Object
@@ -18,5 +17,3 @@
1817
#define BUFFER_FORMAT "q"
1918

2019
#include "vec_template.c"
21-
22-
#endif // MYPYC_EXPERIMENTAL

mypyc/lib-rt/vecs/vec_nested.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#ifdef MYPYC_EXPERIMENTAL
21
// Implementation of nested vec[t], when t is a vec type.
32
//
43
// Examples of types supported:
@@ -764,5 +763,3 @@ VecNestedAPI Vec_NestedAPI = {
764763
VecNested_Extend,
765764
VecNested_ExtendVec,
766765
};
767-
768-
#endif // MYPYC_EXPERIMENTAL

0 commit comments

Comments
 (0)