Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace macro locking with an internal RAII-style C++ API
Force all macro access through a C++ class which locks the context in constructor, convert all access to go through it and voila. This lets caller do multiple macro operations on one lock/unlock cycle, whereas the C API is forced to do one on each and every call. Generally the APIs with their C strings have been left alone, but the expand variants always return an actual result code, and take and return C++ strings to free callers, which is the other big benefit here. This looks big but is actually rather straightforward. New tests are not really needed because the C API internally now uses this API, and that gets thoroughly exercised.
- Loading branch information