evas_gl : Fixed macro substitution bug in evas_gl
authorSung W. Park <dunamis.park@samsung.com>
Wed, 13 Nov 2013 06:39:12 +0000 (15:39 +0900)
committerSung W. Park <dunamis.park@samsung.com>
Wed, 13 Nov 2013 06:39:12 +0000 (15:39 +0900)
commit90bbc21d02b9cdc7e074884812950d27e015c2ac
tree9d054cd04f3f14e91e9dadcf6218ae6c1eaf26fe
parent2dc092d36e0741bcdffca23f82b2acbac8e0cda7
evas_gl : Fixed macro substitution bug in evas_gl

In evas_gl_api_ext_def.h there're calls such as:

    _EVASGL_EXT_DRVNAME(EGL_KHR_image_base)

    The macro is defined in evas_gl_api_ext.c as:

    (strstr(glexts, #name) != NULL || strstr(glueexts, #name) != NULL)

    if (_EVASGL_EXT_CHECK_SUPPORT(name)) *ext_support = 1;

    But EGL_KHR_image_base is itself a macro, which is defined
    in EGL/eglext.h like this:

    Thus, the _EVASGL_EXT_CHECK_SUPPORT macro will unwrap into:

    (strstr(glexts, "1") != NULL || strstr(glueexts, "1") != NULL)

    instead of intended:

    (strstr(glexts, "EGL_KHR_image_base") != NULL ||
     strstr(glueexts, "EGL_KHR_image_base") != NULL)

    This patch fixes this by applying stringification earlier in
    _EVASGL_EXT_DRVNAME

Bugfix reported by jinhyung.jo@samsung.com
src/modules/evas/engines/gl_common/evas_gl_api_ext.c