summaryrefslogtreecommitdiff
path: root/src/io/fd.hpp
diff options
context:
space:
mode:
authorBen Longbons <b.r.longbons@gmail.com>2014-06-27 19:16:45 -0700
committerBen Longbons <b.r.longbons@gmail.com>2014-06-27 19:33:42 -0700
commit7af4c5b5c561362cb1135ab504095ae667a9270a (patch)
tree49ffd3008d7634ba36f3951493a68e928407ce89 /src/io/fd.hpp
parent8d7f1dadeeb1dc1609b72de5a4ee3a5247b0e9e6 (diff)
downloadtmwa-7af4c5b5c561362cb1135ab504095ae667a9270a.tar.gz
tmwa-7af4c5b5c561362cb1135ab504095ae667a9270a.tar.bz2
tmwa-7af4c5b5c561362cb1135ab504095ae667a9270a.tar.xz
tmwa-7af4c5b5c561362cb1135ab504095ae667a9270a.zip
This is more reliable
Diffstat (limited to 'src/io/fd.hpp')
-rw-r--r--src/io/fd.hpp31
1 files changed, 14 insertions, 17 deletions
diff --git a/src/io/fd.hpp b/src/io/fd.hpp
index 9ea4d41..d725c8a 100644
--- a/src/io/fd.hpp
+++ b/src/io/fd.hpp
@@ -1,5 +1,4 @@
-#ifndef TMWA_IO_FD_HPP
-#define TMWA_IO_FD_HPP
+#pragma once
// io/fd.hpp - typesafe (but not scopesafe) file descriptors
//
// Copyright © 2014 Ben Longbons <b.r.longbons@gmail.com>
@@ -19,12 +18,12 @@
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
-# include "fwd.hpp"
+#include "fwd.hpp"
-# include <sys/select.h>
-# include <sys/socket.h>
+#include <sys/select.h>
+#include <sys/socket.h>
-# include "../strings/fwd.hpp"
+#include "../strings/fwd.hpp"
namespace tmwa
@@ -138,24 +137,24 @@ namespace io
}
void clr(FD fd)
{
-# pragma GCC diagnostic push
-# pragma GCC diagnostic ignored "-Wold-style-cast"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wold-style-cast"
FD_CLR(fd.uncast_dammit(), &fds);
-# pragma GCC diagnostic pop
+#pragma GCC diagnostic pop
}
bool isset(FD fd)
{
-# pragma GCC diagnostic push
-# pragma GCC diagnostic ignored "-Wold-style-cast"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wold-style-cast"
return FD_ISSET(fd.uncast_dammit(), &fds);
-# pragma GCC diagnostic pop
+#pragma GCC diagnostic pop
}
void set(FD fd)
{
-# pragma GCC diagnostic push
-# pragma GCC diagnostic ignored "-Wold-style-cast"
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wold-style-cast"
FD_SET(fd.uncast_dammit(), &fds);
-# pragma GCC diagnostic pop
+#pragma GCC diagnostic pop
}
static
@@ -165,5 +164,3 @@ namespace io
};
} // namespace io
} // namespace tmwa
-
-#endif // TMWA_IO_FD_HPP