Browse Source

ext: Use different names for each gen_next method

darktohka 1 year ago
parent
commit
b049c891d1

+ 2 - 2
direct/src/interval/cInterval_ext.cxx

@@ -24,7 +24,7 @@ extern struct Dtool_PyTypedObject Dtool_CInterval;
 /**
  * Yields continuously until the interval is done.
  */
-static PyObject *gen_next(PyObject *self) {
+static PyObject *gen_next_c_interval(PyObject *self) {
   const CInterval *ival;
   if (!Dtool_Call_ExtractThisPointer(self, Dtool_CInterval, (void **)&ival)) {
     return nullptr;
@@ -54,7 +54,7 @@ __await__(PyObject *self) {
   // we call this via Python.
   PyObject *result = PyObject_CallMethod(self, "start", nullptr);
   Py_XDECREF(result);
-  return Dtool_NewGenerator(self, &gen_next);
+  return Dtool_NewGenerator(self, &gen_next_c_interval);
 }
 
 #endif  // HAVE_PYTHON

+ 2 - 2
dtool/src/dtoolutil/iostream_ext.cxx

@@ -227,7 +227,7 @@ readlines(Py_ssize_t hint) {
 /**
  * Yields continuously to read all the lines from the istream.
  */
-static PyObject *gen_next(PyObject *self) {
+static PyObject *gen_next_istream(PyObject *self) {
   istream *stream = nullptr;
   if (!Dtool_Call_ExtractThisPointer(self, Dtool_std_istream, (void **)&stream)) {
     return nullptr;
@@ -247,7 +247,7 @@ static PyObject *gen_next(PyObject *self) {
  */
 PyObject *Extension<istream>::
 __iter__(PyObject *self) {
-  return Dtool_NewGenerator(self, &gen_next);
+  return Dtool_NewGenerator(self, &gen_next_istream);
 }
 
 /**

+ 2 - 2
panda/src/event/asyncFuture_ext.cxx

@@ -132,7 +132,7 @@ static PyObject *get_done_result(const AsyncFuture *future) {
 /**
  * Yields continuously until the task has finished.
  */
-static PyObject *gen_next(PyObject *self) {
+static PyObject *gen_next_asyncfuture(PyObject *self) {
   const AsyncFuture *future = nullptr;
   if (!Dtool_Call_ExtractThisPointer(self, Dtool_AsyncFuture, (void **)&future)) {
     return nullptr;
@@ -158,7 +158,7 @@ static PyObject *gen_next(PyObject *self) {
  */
 PyObject *Extension<AsyncFuture>::
 __await__(PyObject *self) {
-  return Dtool_NewGenerator(self, &gen_next);
+  return Dtool_NewGenerator(self, &gen_next_asyncfuture);
 }
 
 /**