Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

py: Fix compilation of persistentcode with uncommon configs #4753

Closed
wants to merge 2 commits into from

Commits on May 6, 2019

  1. py: define EMIT_ANY_ASM = EMIT_NATIVE || EMIT_INLINE_ASM

    There are a lot of places testing MICROPY_EMIT_NATIVE || MICROPY_EMIT_INLINE_ASM.
    
    Define a new macro for it.
    quark-zju committed May 6, 2019
    Configuration menu
    Copy the full SHA
    ad8a204 View commit details
    Browse the repository at this point in the history
  2. py: Fix compilation of persistentcode with uncommon configs

    With the following configuration:
    
        #define MICROPY_PERSISTENT_CODE_SAVE (1)
        #define MICROPY_PERSISTENT_CODE_LOAD (1)
    
    The code fails to compile:
    
        persistentcode.c: In function 'load_raw_code':
        persistentcode.c:457:13: error: 'n_obj' undeclared
                 n_obj, n_raw_code,
    
    If MICROPY_EMIT_NATIVE disabled, there are more errors due to the use of
    undefined fields in mp_raw_code_t.
    
    This patch fixes compilation by avoiding undefined fields.
    
    MICROPY_EMIT_NATIVE was changed to MICROPY_EMIT_ANY_ASM in this file to
    match mp_raw_code_t definition.
    quark-zju committed May 6, 2019
    Configuration menu
    Copy the full SHA
    96e50c5 View commit details
    Browse the repository at this point in the history