obsproject / obs-browser

CEF-based OBS Studio browser plugin
GNU General Public License v2.0
771 stars 218 forks source link

Fix macro-redefine warning with Qt loop enabled #368

Closed tytan652 closed 2 years ago

tytan652 commented 2 years ago

Description

Remove the "original" UNUSED_PARAMETER and add the needed header file without guard.

Motivation and Context

I'm actually working on a PR to treat warnings as errors.

How Has This Been Tested?

The warning/error no longer appear while building OBS Studio with this PR.

Types of changes

Checklist:

gxalpha commented 2 years ago

To me it feels like the better fix would be using the existing macro instead of redefining a new one. My assumption is that the redefinition is from a time where out-of-tree builds for obs-browser were a thing and as such the libobs one couldn't be relied on, but that's not supported anymore.

tytan652 commented 2 years ago

The two macros looked are different. This is why I just use a #undef.

RytoEX commented 2 years ago

The two macros are different. This is why I just use a #undef.

Not sure what you mean by different: https://github.com/obsproject/obs-studio/blob/9168797361e0c6cddbfd06761bfbca136960e93d/libobs/util/c99defs.h#L24

#define UNUSED_PARAMETER(param) (void)param

https://github.com/obsproject/obs-browser/blob/b798763ae75b538e405c2d7e2ab3a1edfe59ed0c/browser-app.cpp#L34-L37

#define UNUSED_PARAMETER(x) \
    {                   \
        (void)x;    \
    }

These look functionally the same to me.

tytan652 commented 2 years ago

Waiting for obs-studio CI to check if the commit works.