Skip to content
This repository was archived by the owner on Mar 12, 2026. It is now read-only.
This repository was archived by the owner on Mar 12, 2026. It is now read-only.

OSX 10.12 compile conflict when including regex #18

@Daandelange

Description

@Daandelange

Hello,
I stumbled upon an issue on osx 10.12.0 when compiling a program using ofxPython, python 2.7 and libC++'s regex. (Osx 10.13 and 10.14 don't seem to be concerned.)
I'm using XCode 8.1.

To reproduce :

#include "ofxPython.h" // --> loads /usr/include/python2.7/pyport.h
//#undef tolower // <-- uncomment to "fix" compilation issue
#include <regex> // --> /usr/include/c++/v1/regex

This leads to a macro-definition conflict. ofxPython defines tolower, which is also used by libc++'s std::regex : /usr/include/c++/v1/regex:1216: error: too many arguments provided to function-like macro invocation : __ct_->tolower(&__s[0], &__s[0] + __s.size());

A temporary (and dirty) workaround is to reset the tolower macros before the regex include.
I have no idea how this affects the inner workings of python.

This issue is rather related to pyport.h from the Python project.
Reporting this issue to share my findings. Feel free to close anytime.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions