Skip to content

Commit

Permalink
fix repeted call for objs functions declaration
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesneimog committed Oct 5, 2023
1 parent fd53d2e commit d965021
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions pd4web/pd4web.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ def __init__(self, sourcefile="src/template.c", pdpatch=None,
os.mkdir(self.PdWebCompilerPath + "/.externals")

self.externalsExtraFunctions = []
self.addedObjects = []
self.supportedObjects = {}
self.unsupportedObjects = {}
if not insideaddAbstractions:
Expand All @@ -106,6 +107,7 @@ def __init__(self, sourcefile="src/template.c", pdpatch=None,
else:
self.downloadSources = parent.downloadSources
self.externalsExtraFunctions = parent.externalsExtraFunctions
self.addedObjects = parent.addedObjects

if self.PROJECT_ROOT[-1] != "/" and (self.PROJECT_ROOT[-1] != "\\"):
if platform.system() == "Windows":
Expand Down Expand Up @@ -275,6 +277,7 @@ def main(self, pdpatch=None, insideaddAbstractions=False):
[self.parent.sortedSourceFiles.append(sourceFile) for sourceFile in self.sortedSourceFiles]
[self.parent.PROCESSED_ABSTRACTIONS.append(pdpatch) for pdpatch in self.PROCESSED_ABSTRACTIONS]
[self.parent.unsupportedObjects.append(obj) for obj in self.unsupportedObjects]
self.parent.addedObjects = self.addedObjects

if not insideaddAbstractions:
self.getDynamicLibraries()
Expand Down Expand Up @@ -720,10 +723,9 @@ def addObjSetup(self):
'''
This function will add the obj_setup() inside the main.c file
'''
addedFunctions = []
for lineInfo in self.PatchLinesExternals:
if lineInfo.functionName not in addedFunctions:
addedFunctions.append(lineInfo.functionName)
if lineInfo.functionName not in self.addedObjects:
self.addedObjects.append(lineInfo.functionName)
if lineInfo.isExternal and lineInfo.objFound:
start_index = None
end_index = None
Expand Down

0 comments on commit d965021

Please sign in to comment.