Skip to content

FontData.h: small enum value conflicts with Windows SDK rpcndr.h macro #354

Description

@rpatters1

Description

Including Windows headers before mx/api/FontData.h can cause compilation to fail because the Windows SDK’s rpcndr.h defines:

#define small char

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.

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