When a single .c file contains several functions and/or methods with
the same name, a safety _METHODDEF GH-define statement is generated
only for one of them.
This fixes the bug by using the full name of the function to avoid
duplicates rather than just the name..
(cherry picked from commit
4f57409a2f7bdf8fb559cddc7c6533ca2c471c67)
--- /dev/null
+Fixed Argument Clinic sometimes causing compilation errors when there was
+more than one function and/or method in a .c file with the same name.
#ifndef ZLIB_COMPRESS_COPY_METHODDEF
#define ZLIB_COMPRESS_COPY_METHODDEF
#endif /* !defined(ZLIB_COMPRESS_COPY_METHODDEF) */
-/*[clinic end generated code: output=3a4e2bfe750423a3 input=a9049054013a1b77]*/
+
+#ifndef ZLIB_DECOMPRESS_COPY_METHODDEF
+ #define ZLIB_DECOMPRESS_COPY_METHODDEF
+#endif /* !defined(ZLIB_DECOMPRESS_COPY_METHODDEF) */
+/*[clinic end generated code: output=497dad1132c962e2 input=a9049054013a1b77]*/
{
ZLIB_COMPRESS_COMPRESS_METHODDEF
ZLIB_COMPRESS_FLUSH_METHODDEF
-#ifdef HAVE_ZLIB_COPY
ZLIB_COMPRESS_COPY_METHODDEF
-#endif
{NULL, NULL}
};
{
ZLIB_DECOMPRESS_DECOMPRESS_METHODDEF
ZLIB_DECOMPRESS_FLUSH_METHODDEF
-#ifdef HAVE_ZLIB_COPY
ZLIB_DECOMPRESS_COPY_METHODDEF
-#endif
{NULL, NULL}
};
cpp_if = "#if " + conditional
cpp_endif = "#endif /* " + conditional + " */"
- if methoddef_define and f.name not in clinic.ifndef_symbols:
- clinic.ifndef_symbols.add(f.name)
+ if methoddef_define and f.full_name not in clinic.ifndef_symbols:
+ clinic.ifndef_symbols.add(f.full_name)
methoddef_ifndef = normalize_snippet("""
#ifndef {methoddef_name}
#define {methoddef_name}