Skip to content

C API pollutes the global namespace #40083

@elbaro

Description

@elbaro

🐛 Bug

libtorch/include/c10/util/logging_is_not_google_glog.h exposes ERROR, FATAL, etc in the global namespace.
This is included by torch/script.h.

This causes the conflict with a user code.

Expected behavior

Put them in some namespace.

Environment

build-hash: 4ff3872...
build-version: 1.5.0+cpu

cc @malfet @yf225 @glaringlee

Metadata

Metadata

Assignees

No one assigned

    Labels

    better-engineeringRelatively self-contained tasks for better engineering contributorsmodule: buildBuild system issuesmodule: cppRelated to C++ APItriagedThis issue has been looked at a team member, and triaged and prioritized into an appropriate module

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions