Changeset 13553


Ignore:
Timestamp:
Sep 20, 2019 11:58:54 AM (3 months ago)
Author:
Christian Andersson
Message:

Moved a few c functions to the template. Related to ticket:5837

Location:
branches/dev-cw-evaluator
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/dev-cw-evaluator/Compiler/ModelicaCBackEnd/templates/ceval_external_template.c

    r13534 r13553  
    1515
    1616#include "jmi_evaluator_util.h"
     17
     18/* Must be defined here in order to override the methods from jmi_global.c */
     19void jmi_global_log(int warning, const char* name, const char* fmt, const char* value) {
     20    _jmi_global_log(warning, name, fmt, value);
     21}
     22void jmi_throw() {
     23    _jmi_throw();
     24}
     25void* jmi_global_calloc(size_t n, size_t s) {
     26    return _jmi_global_calloc(n,s);
     27}
    1728
    1829$ECE_external_includes$
  • branches/dev-cw-evaluator/RuntimeLibrary/src/evaluator/jmi_evaluator.c

    r13548 r13553  
    11#include "jmi_evaluator_util.h"
     2
     3/* Must be defined here in order to override the methods from jmi_global.c */
     4void jmi_global_log(int warning, const char* name, const char* fmt, const char* value) {
     5    _jmi_global_log(warning, name, fmt, value);
     6}
     7void jmi_throw() {
     8    _jmi_throw();
     9}
     10void* jmi_global_calloc(size_t n, size_t s) {
     11    return _jmi_global_calloc(n,s);
     12}
    213
    314/* Builtins */
  • branches/dev-cw-evaluator/RuntimeLibrary/src/evaluator/jmi_evaluator_util.c

    r13534 r13553  
    8585}
    8686
    87 /* Used by ModelicaUtilities */
    88 void jmi_global_log(int warning, const char* name, const char* fmt, const char* value) {
     87void _jmi_global_log(int warning, const char* name, const char* fmt, const char* value) {
    8988    printf("LOG\n");
    9089    JMCEVAL_printInteger((double)warning);
     
    10099}
    101100
    102 void jmi_throw() {
     101void _jmi_throw() {
    103102    longjmp(jmceval_try_location, 1);
    104103}
     
    111110}
    112111
    113 void* jmi_global_calloc(size_t n, size_t s) {
     112void* _jmi_global_calloc(size_t n, size_t s) {
    114113    return jmi_dynamic_function_pool_direct_alloc(dyn_fcn_mem, n*s, 1);
    115114}
  • branches/dev-cw-evaluator/RuntimeLibrary/src/evaluator/jmi_evaluator_util.h

    r13534 r13553  
    7777void JMCEVAL_check(const char* str);
    7878void JMCEVAL_failed();
    79 void jmi_global_log(int warning, const char* name, const char* fmt, const char* value);
    80 void jmi_throw();
     79void _jmi_global_log(int warning, const char* name, const char* fmt, const char* value);
     80void _jmi_throw();
    8181int JMCEVAL_try();
    82 void* jmi_global_calloc(size_t n, size_t s);
     82void* _jmi_global_calloc(size_t n, size_t s);
    8383jmi_dynamic_function_memory_t* jmi_dynamic_function_memory();
    8484
Note: See TracChangeset for help on using the changeset viewer.