Commit 5a87d0eb authored by Maxime Perrotin's avatar Maxime Perrotin
Browse files

Declare the Startup procedure in the .ads

It was declared in the .adb, thus not visible when the module was
imported from an Ada file
parent 0a4f1eef
...@@ -142,6 +142,9 @@ The background pattern was downloaded from www.subtlepatterns.com ...@@ -142,6 +142,9 @@ The background pattern was downloaded from www.subtlepatterns.com
Changelog Changelog
========= =========
1.5.23 (12/2016) minor bugfix
- In simulation mode, bugfix in the declaration of the startup function
1.5.22 (12/2016) 1.5.22 (12/2016)
- Simulation function save/restore context fix - Simulation function save/restore context fix
......
...@@ -316,10 +316,7 @@ LD_LIBRARY_PATH=. opengeode-simulator ...@@ -316,10 +316,7 @@ LD_LIBRARY_PATH=. opengeode-simulator
start_transition.append(u'runTransition(0);') start_transition.append(u'runTransition(0);')
start_transition.append(initDone) start_transition.append(initDone)
else: else:
start_transition = [u'procedure Startup;', start_transition = [u'procedure Startup is',
u'pragma Export(C, Startup, "{}_startup");'
.format(process_name),
u'procedure Startup is',
u'begin', u'begin',
u' runTransition(0);' if process.transitions u' runTransition(0);' if process.transitions
else 'null;', else 'null;',
...@@ -406,6 +403,11 @@ package {process_name} is'''.format(process_name=process_name, ...@@ -406,6 +403,11 @@ package {process_name} is'''.format(process_name=process_name,
dll_api.append("end restore_context;") dll_api.append("end restore_context;")
dll_api.append("") dll_api.append("")
# Declare procedure Startup in .ads
ads_template.append(u'procedure Startup;')
ads_template.append(u'pragma Export(C, Startup, "{}_startup");'
.format(process_name))
# interface to get/set state aggregations XXX add to C generator # interface to get/set state aggregations XXX add to C generator
for substates in aggregates.viewvalues(): for substates in aggregates.viewvalues():
for each in substates: for each in substates:
...@@ -419,13 +421,7 @@ package {process_name} is'''.format(process_name=process_name, ...@@ -419,13 +421,7 @@ package {process_name} is'''.format(process_name=process_name,
# Functions to get gobal variables (length and value) # Functions to get gobal variables (length and value)
for var_name, (var_type, _) in process.variables.viewitems(): for var_name, (var_type, _) in process.variables.viewitems():
# Getters for local variables # Getters for external applications to view local variables via dll
# Removed size - this was needed by swig only, not ctypes
# process_level_decl.append("function l_{name}_size return integer "
# "is ({prefix}.{name}'Size/8) with Export,"
# " Convention => C,"
# ' Link_Name => "{name}_size";'
# .format(prefix=LPREFIX, name=var_name))
process_level_decl.append("function l_{name}_value" process_level_decl.append("function l_{name}_value"
" return access {sort} " " return access {sort} "
"is ({prefix}.{name}'access) with Export," "is ({prefix}.{name}'access) with Export,"
......
...@@ -138,7 +138,7 @@ except ImportError: ...@@ -138,7 +138,7 @@ except ImportError:
__all__ = ['opengeode', 'SDL_Scene', 'SDL_View', 'parse'] __all__ = ['opengeode', 'SDL_Scene', 'SDL_View', 'parse']
__version__ = '1.5.22' __version__ = '1.5.23'
if hasattr(sys, 'frozen'): if hasattr(sys, 'frozen'):
# Detect if we are running on Windows (py2exe-generated) # Detect if we are running on Windows (py2exe-generated)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment