File tree 4 files changed +24
-2
lines changed
4 files changed +24
-2
lines changed Original file line number Diff line number Diff line change 1
1
#pragma once
2
2
3
- #include < filesystem>
3
+ #ifdef FILESYSTEM_EXPERIMENTAL
4
+ #include < experimental/filesystem>
5
+ #else
6
+ #include < filesystem>
7
+ #endif
4
8
#include < fstream>
5
9
#include < iostream>
6
10
#include < fmt/format.h>
11
15
12
16
namespace waybar ::modules {
13
17
18
+ #ifdef FILESYSTEM_EXPERIMENTAL
19
+ namespace fs = std::experimental::filesystem;
20
+ #else
14
21
namespace fs = std::filesystem;
22
+ #endif
15
23
16
24
class Battery : public ALabel {
17
25
public:
Original file line number Diff line number Diff line change 3
3
#include < dbus-status-notifier-item.h>
4
4
#include < gtkmm.h>
5
5
#include < json/json.h>
6
- #include < filesystem>
6
+ #ifdef FILESYSTEM_EXPERIMENTAL
7
+ #include < experimental/filesystem>
8
+ #else
9
+ #include < filesystem>
10
+ #endif
7
11
8
12
namespace waybar ::modules::SNI {
9
13
Original file line number Diff line number Diff line change @@ -83,6 +83,12 @@ if dbusmenu_gtk.found()
83
83
)
84
84
endif
85
85
86
+ compiler = meson .get_compiler(' cpp' )
87
+
88
+ if not compiler.has_header(' filesystem' )
89
+ add_project_arguments (' -DFILESYSTEM_EXPERIMENTAL' , language : ' cpp' )
90
+ endif
91
+
86
92
subdir (' protocol' )
87
93
88
94
executable (
Original file line number Diff line number Diff line change @@ -190,7 +190,11 @@ void waybar::modules::SNI::Item::updateImage()
190
190
if (!icon_name.empty ()) {
191
191
try {
192
192
// Try to find icons specified by path and filename
193
+ #ifdef FILESYSTEM_EXPERIMENTAL
194
+ if (std::experimental::filesystem::exists (icon_name)) {
195
+ #else
193
196
if (std::filesystem::exists (icon_name)) {
197
+ #endif
194
198
auto pixbuf = Gdk::Pixbuf::create_from_file (icon_name);
195
199
if (pixbuf->gobj () != nullptr ) {
196
200
// An icon specified by path and filename may be the wrong size for
You can’t perform that action at this time.
0 commit comments