update ICD loader generation scripts to handle empty arguments (#150)
authorBen Ashbaugh <ben.ashbaugh@intel.com>
Mon, 21 Jun 2021 17:52:29 +0000 (10:52 -0700)
committerGitHub <noreply@github.com>
Mon, 21 Jun 2021 17:52:29 +0000 (10:52 -0700)
scripts/gen/__init__.py

index 167a4305c42c5c59d0bba8253fc30d1f04090192..3cae3f65c03575c150031df6c44e3b1f8e020083 100644 (file)
@@ -92,6 +92,12 @@ def get_apisigs(spec):
             ptypeend = ptypeend.strip()
             pname = pname.strip()
             plist.append(ApiParam(ptype, ptypeend, pname))
+
+        # For an empty parameter list (for e.g. clUnloadCompiler), add a single
+        # unnamed void parameter to make generation easier.
+        if len(plist) == 0:
+            plist.append(ApiParam("void", "", ""))
+
         apisigs[name] = ApiSignature(name, ret, plist, suffix)
     return apisigs