Skip to content

Commit

Permalink
Replace #pragma once to #ifndef
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackarain committed Oct 18, 2023
1 parent fd0d058 commit 9271649
Show file tree
Hide file tree
Showing 14 changed files with 69 additions and 14 deletions.
5 changes: 4 additions & 1 deletion proxy/include/proxy/async_connect.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#pragma once
#ifndef INCLUDE__2023_10_18__ASYNC_CONNECT_HPP
#define INCLUDE__2023_10_18__ASYNC_CONNECT_HPP

#include <boost/asio/dispatch.hpp>
#include <boost/asio/connect.hpp>
Expand Down Expand Up @@ -445,3 +446,5 @@ namespace asio_util {
endpoints, connect_condition);
}
}

#endif // INCLUDE__2023_10_18__ASYNC_CONNECT_HPP
5 changes: 4 additions & 1 deletion proxy/include/proxy/base_stream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
// Email: jack.wgm at gmail dot com
//

#pragma once
#ifndef INCLUDE__2023_10_18__BASE_STREAM_HPP
#define INCLUDE__2023_10_18__BASE_STREAM_HPP

#include <boost/variant2.hpp>
#include <boost/system/error_code.hpp>
Expand Down Expand Up @@ -161,3 +162,5 @@ namespace util {
}

}

#endif // INCLUDE__2023_10_18__BASE_STREAM_HPP
6 changes: 5 additions & 1 deletion proxy/include/proxy/default_cert.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
// Email: jack.wgm at gmail dot com
//

#pragma once
#ifndef INCLUDE__2023_10_18__DEFAULT_CERT_HPP
#define INCLUDE__2023_10_18__DEFAULT_CERT_HPP


#include <string_view>

Expand Down Expand Up @@ -18010,3 +18012,5 @@ inline std::string_view default_root_certificates()

return std::string_view((const char*)&cacert_2023_05_30_pem, cacert_2023_05_30_pem_len);
}

#endif // INCLUDE__2023_10_18__DEFAULT_CERT_HPP
8 changes: 7 additions & 1 deletion proxy/include/proxy/fileop.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,12 @@
// Email: jack.wgm at gmail dot com
//

#pragma once
#ifndef INCLUDE__2023_10_18__FILEOP_HPP
#define INCLUDE__2023_10_18__FILEOP_HPP


#include <cstdint>
#include <fstream>
#include <streambuf>
#include <string>
#include <vector>
Expand Down Expand Up @@ -170,3 +174,5 @@ namespace fileop {
return write(*f.rdbuf(), val);
}
}

#endif // INCLUDE__2023_10_18__FILEOP_HPP
6 changes: 5 additions & 1 deletion proxy/include/proxy/http_proxy_client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#pragma once
#ifndef INCLUDE__2023_10_18__HTTP_PROXY_CLIENT_HPP
#define INCLUDE__2023_10_18__HTTP_PROXY_CLIENT_HPP


#include "proxy/use_awaitable.hpp"
#include "proxy/strutil.hpp"
Expand Down Expand Up @@ -150,3 +152,5 @@ namespace proxy {
detail::initiate_do_http_proxy(), handler, &socket, opt);
}
}

#endif // INCLUDE__2023_10_18__HTTP_PROXY_CLIENT_HPP
6 changes: 5 additions & 1 deletion proxy/include/proxy/proxy_server.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#pragma once
#ifndef INCLUDE__2023_10_18__PROXY_SERVER_HPP
#define INCLUDE__2023_10_18__PROXY_SERVER_HPP


#include "proxy/use_awaitable.hpp"
#include "proxy/scoped_exit.hpp"
Expand Down Expand Up @@ -3081,3 +3083,5 @@ Content-Length: 0
};

}

#endif // INCLUDE__2023_10_18__PROXY_SERVER_HPP
6 changes: 5 additions & 1 deletion proxy/include/proxy/scoped_exit.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
// Email: jack.wgm at gmail dot com
//

#pragma once
#ifndef INCLUDE__2023_10_18__SCOPED_EXIT_HPP
#define INCLUDE__2023_10_18__SCOPED_EXIT_HPP


#include <type_traits>

Expand Down Expand Up @@ -66,3 +68,5 @@ class scoped_exit
T f_;
bool stop_token_{ false };
};

#endif // INCLUDE__2023_10_18__SCOPED_EXIT_HPP
5 changes: 4 additions & 1 deletion proxy/include/proxy/socks_client.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#pragma once
#ifndef INCLUDE__2023_10_18__SOCKS_CLIENT_HPP
#define INCLUDE__2023_10_18__SOCKS_CLIENT_HPP


#include "proxy/socks_error_code.hpp"
#include "proxy/socks_enums.hpp"
Expand Down Expand Up @@ -554,3 +556,4 @@ namespace proxy {

}

#endif // INCLUDE__2023_10_18__SOCKS_CLIENT_HPP
6 changes: 5 additions & 1 deletion proxy/include/proxy/socks_enums.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#pragma once
#ifndef INCLUDE__2023_10_18__SOCKS_ENUMS_HPP
#define INCLUDE__2023_10_18__SOCKS_ENUMS_HPP


namespace proxy {

Expand Down Expand Up @@ -55,3 +57,5 @@ namespace proxy {
};

}

#endif // INCLUDE__2023_10_18__SOCKS_ENUMS_HPP
6 changes: 5 additions & 1 deletion proxy/include/proxy/socks_error_code.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#pragma once
#ifndef INCLUDE__2023_10_18__SOCKS_ERROR_CODE_HPP
#define INCLUDE__2023_10_18__SOCKS_ERROR_CODE_HPP


#include <boost/system/error_code.hpp>

Expand Down Expand Up @@ -167,3 +169,5 @@ namespace boost::system {
static const inline bool value = true;
};
} // namespace boost

#endif // INCLUDE__2023_10_18__SOCKS_ERROR_CODE_HPP
6 changes: 5 additions & 1 deletion proxy/include/proxy/socks_io.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#pragma once
#ifndef INCLUDE__2023_10_18__SOCKS_IO_HPP
#define INCLUDE__2023_10_18__SOCKS_IO_HPP


#include <cstddef>

Expand All @@ -32,3 +34,5 @@ namespace io_util {
}

}

#endif // INCLUDE__2023_10_18__SOCKS_IO_HPP
6 changes: 5 additions & 1 deletion proxy/include/proxy/strutil.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
******************************************************************************
*/

#pragma once
#ifndef INCLUDE__2023_10_18__STRUTIL_HPP
#define INCLUDE__2023_10_18__STRUTIL_HPP


#include <algorithm>
#include <cctype>
Expand Down Expand Up @@ -1479,3 +1481,5 @@ namespace strutil
}

}

#endif // INCLUDE__2023_10_18__STRUTIL_HPP
6 changes: 5 additions & 1 deletion proxy/include/proxy/use_awaitable.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#pragma once
#ifndef INCLUDE__2023_10_18__USE_AWAITABLE_HPP
#define INCLUDE__2023_10_18__USE_AWAITABLE_HPP


#include <boost/type_traits.hpp>
#include <boost/asio/io_context.hpp>
Expand Down Expand Up @@ -57,3 +59,5 @@ namespace asio_util
[[maybe_unused]] inline constexpr
asio_util::asio_use_awaitable_t<
boost::asio::io_context::executor_type> ioc_awaitable;

#endif // INCLUDE__2023_10_18__USE_AWAITABLE_HPP
6 changes: 5 additions & 1 deletion server/proxy_server/main.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//

#pragma once
#ifndef INCLUDE__2023_10_18__MAIN_HPP
#define INCLUDE__2023_10_18__MAIN_HPP


#include <string>
#include <string_view>
Expand Down Expand Up @@ -119,3 +121,5 @@ inline bool parse_endpoint_string(std::string_view str,

return true;
}

#endif // INCLUDE__2023_10_18__MAIN_HPP

0 comments on commit 9271649

Please sign in to comment.