Skip to content

Commit

Permalink
playsound: Remove __has_include macro for <alsa/asoundlib.h> (#851)
Browse files Browse the repository at this point in the history
alsa-libのヘッダーファイル `alsa/asoundlib.h` は2001年[1]から
導入されているため現状サポートしているディストロでは利用可能です。
そのためヘッダーのチェックを整理してcppcheckのレポート(誤検知?)
を解消します。

cppcheck 2.3のレポート
```
src/sound/playsound.cpp:15:0: error: failed to evaluate #if condition, division/modulo by zero [preprocessorErrorDirective]
\#if __has_include(<alsa/asoundlib.h>)
^
```

[1]: alsa-project/alsa-lib@0a8749a
  • Loading branch information
ma8ma committed Nov 7, 2021
1 parent 7576ef1 commit 7166305
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
9 changes: 4 additions & 5 deletions src/sound/playsound.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,13 @@

#include "jdlib/miscmsg.h"

#include <alsa/asoundlib.h>

#include <algorithm>
#include <cstdio>
#include <string>
#include <vector>
#if __has_include(<alsa/asoundlib.h>)
#include <alsa/asoundlib.h>
#else
#include <asoundlib.h>
#endif


using namespace SOUND;

Expand Down
2 changes: 0 additions & 2 deletions src/sound/playsound.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
#include "skeleton/dispatchable.h"
#include "jdlib/jdthread.h"

#include <gtkmm.h>

#include <cstdint>


Expand Down

0 comments on commit 7166305

Please sign in to comment.