import logging


def _decodeCPPStd( version, strictAnsi ):
    """
        Decodes the C standard given the values of the macros
        __cplusplus and __STRICT_ANSI__
    """
    retVal = None

    if version == '199711L' and strictAnsi == '1':
        retVal = 'c++03'

    elif version == '199711L' and strictAnsi == '__STRICT_ANSI__':
        retVal = 'gnu++03'

    elif version == '201103L' and strictAnsi == '1':
        retVal = 'c++11'

    elif version == '201103L' and strictAnsi == '__STRICT_ANSI__':
        retVal = 'gnu++11'

    elif version == '201402L' and strictAnsi == '1':
        retVal = 'c++14'

    elif version == '201402L' and strictAnsi == '__STRICT_ANSI__':
        retVal = 'gnu++14'

    elif version == '201500L' and strictAnsi == '1':
        retVal = 'c++1z'

    elif version == '201500L' and strictAnsi == '__STRICT_ANSI__':
        retVal = 'gnu++1z'
    else:
        logging.warning('Cannot decode default language standard for C++.')

    return retVal