bombomby / optick

C++ Profiler For Games
https://optick.dev
MIT License
2.95k stars 296 forks source link

The Profiler namespace should be prefixed by :: to avoid name collision #11

Closed Onduril closed 8 years ago

Onduril commented 8 years ago

Hello

If the brofiler macros is used inside a namespace that itself has a profiler namespace, there will be a name clash (the internal namespace will be preferred). So I suggest to change the macros this way :

define BROFILER_THREAD(FRAME_NAME) ::Profiler::ThreadDescription currentFrameDescription(FRAME_NAME);\

(Profiler is now prefixed with ::)

bombomby commented 8 years ago

Hi, thanks for the report. It's a good idea. I've submitted the suggested fix. By the way, main namespace has recently changed from "Profiler" to "Brofiler". "Profiler" namespace was too popular :) This version hasn't been released yet, but the code is already available.