Skip to content

Macro redefined warnings from pyjniusjni.c #1703

Description

@dbrnz

Building a webview app from the master branch results in macro redefinition errors from pyjniusjni.c. The source code clearly shows the duplicates:

#define LOGI(...) do {} while (0)
#define LOGE(...) do {} while (0)

#include "android/log.h"

/* These JNI management functions are taken from SDL2, but modified to refer to pyjnius */

/* #define LOG(n, x) __android_log_write(ANDROID_LOG_INFO, (n), (x)) */
/* #define LOGP(x) LOG("python", (x)) */
#define LOG_TAG "Python_android"
#define LOGI(...)  __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__)
#define LOGE(...)  __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__)

Is this intended? Does android/log.h need these macros to be no-ops? If so, what about using #undef before redefining them??

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions