Description
Including Windows headers before mx/api/FontData.h can cause compilation to fail because the Windows SDK’s rpcndr.h defines:
FontData.h uses small as an enum value. Once the macro is visible, the preprocessor replaces that identifier before C++ parsing, producing invalid declarations and downstream errors.
This is commonly triggered indirectly by including Windows.h, which pulls in rpcndr.h.
Reproduction
#include <Windows.h>
#include "mx/api/FontData.h"
Compile with MSVC.
Expected behavior
Public mx::api headers should compile regardless of whether Windows headers were included first.
Actual behavior
The small macro from rpcndr.h expands the API enum value and compilation fails.
Possible resolution
Rename the small enumerator to a non-conflicting API name, such as small_, and update its conversion code and call sites. Since this changes a public enum, it should be treated as an API-breaking change or accompanied by an intentional compatibility plan.
Description
Including Windows headers before
mx/api/FontData.hcan cause compilation to fail because the Windows SDK’srpcndr.hdefines:FontData.husessmallas an enum value. Once the macro is visible, the preprocessor replaces that identifier before C++ parsing, producing invalid declarations and downstream errors.This is commonly triggered indirectly by including
Windows.h, which pulls inrpcndr.h.Reproduction
Compile with MSVC.
Expected behavior
Public
mx::apiheaders should compile regardless of whether Windows headers were included first.Actual behavior
The
smallmacro fromrpcndr.hexpands the API enum value and compilation fails.Possible resolution
Rename the small enumerator to a non-conflicting API name, such as
small_, and update its conversion code and call sites. Since this changes a public enum, it should be treated as an API-breaking change or accompanied by an intentional compatibility plan.