diff --git a/src/utils/config_overrides.cpp b/src/utils/config_overrides.cpp index 920dd92..cb56133 100644 --- a/src/utils/config_overrides.cpp +++ b/src/utils/config_overrides.cpp @@ -1,6 +1,6 @@ #include "config_overrides.hpp" -#ifdef EMSCRIPTEN +#ifdef __EMSCRIPTEN__ # include # include @@ -10,7 +10,7 @@ void apply_config_overrides([[maybe_unused]] git_repository* repo) { -#ifdef EMSCRIPTEN +#ifdef __EMSCRIPTEN__ // Config values to override, each in "name=value" form. core.filemode is disabled because // the emscripten filesystem does support executable file permissions but some JupyterLite // drive implementations do not. diff --git a/src/wasm/libgit2_internals.cpp b/src/wasm/libgit2_internals.cpp index 5953424..522c811 100644 --- a/src/wasm/libgit2_internals.cpp +++ b/src/wasm/libgit2_internals.cpp @@ -1,4 +1,4 @@ -#ifdef EMSCRIPTEN +#ifdef __EMSCRIPTEN__ # include "libgit2_internals.hpp" @@ -63,4 +63,4 @@ std::optional select_service(git_smart_service_t action) return std::nullopt; } -#endif // EMSCRIPTEN +#endif // __EMSCRIPTEN__ diff --git a/src/wasm/libgit2_internals.hpp b/src/wasm/libgit2_internals.hpp index 25a90ba..ec39782 100644 --- a/src/wasm/libgit2_internals.hpp +++ b/src/wasm/libgit2_internals.hpp @@ -1,6 +1,6 @@ #pragma once -#ifdef EMSCRIPTEN +#ifdef __EMSCRIPTEN__ # include # include @@ -63,4 +63,4 @@ std::string name_for_method(git_http_method method); std::optional select_service(git_smart_service_t action); -#endif // EMSCRIPTEN +#endif // __EMSCRIPTEN__ diff --git a/src/wasm/read_buffer.cpp b/src/wasm/read_buffer.cpp index c4a59ea..e22619d 100644 --- a/src/wasm/read_buffer.cpp +++ b/src/wasm/read_buffer.cpp @@ -1,4 +1,4 @@ -#ifdef EMSCRIPTEN +#ifdef __EMSCRIPTEN__ # include "read_buffer.hpp" @@ -9,4 +9,4 @@ read_buffer_t::read_buffer_t(char* buffer, size_t buffer_size, size_t* bytes_rea { } -#endif // EMSCRIPTEN +#endif // __EMSCRIPTEN__ diff --git a/src/wasm/read_buffer.hpp b/src/wasm/read_buffer.hpp index e874f26..7d06573 100644 --- a/src/wasm/read_buffer.hpp +++ b/src/wasm/read_buffer.hpp @@ -1,6 +1,6 @@ #pragma once -#ifdef EMSCRIPTEN +#ifdef __EMSCRIPTEN__ # include @@ -15,4 +15,4 @@ struct read_buffer_t size_t* m_bytes_read; }; -#endif // EMSCRIPTEN +#endif // __EMSCRIPTEN__ diff --git a/src/wasm/response.cpp b/src/wasm/response.cpp index af391f8..82a8395 100644 --- a/src/wasm/response.cpp +++ b/src/wasm/response.cpp @@ -1,4 +1,4 @@ -#ifdef EMSCRIPTEN +#ifdef __EMSCRIPTEN__ # include "response.hpp" @@ -82,4 +82,4 @@ void wasm_http_response::set_git_error(std::string_view url) const ); } -#endif // EMSCRIPTEN +#endif // __EMSCRIPTEN__ diff --git a/src/wasm/response.hpp b/src/wasm/response.hpp index 127b705..6a549fe 100644 --- a/src/wasm/response.hpp +++ b/src/wasm/response.hpp @@ -1,6 +1,6 @@ #pragma once -#ifdef EMSCRIPTEN +#ifdef __EMSCRIPTEN__ # include # include @@ -40,4 +40,4 @@ class wasm_http_response std::multimap m_response_headers; }; -#endif // EMSCRIPTEN +#endif // __EMSCRIPTEN__ diff --git a/src/wasm/scope.cpp b/src/wasm/scope.cpp index b6dd4ea..52e49d4 100644 --- a/src/wasm/scope.cpp +++ b/src/wasm/scope.cpp @@ -1,12 +1,12 @@ #include "scope.hpp" -#ifdef EMSCRIPTEN +#ifdef __EMSCRIPTEN__ # include "transport.hpp" #endif wasm_http_transport_scope::wasm_http_transport_scope() { -#ifdef EMSCRIPTEN +#ifdef __EMSCRIPTEN__ git_transport_register("http", create_wasm_http_transport, nullptr); git_transport_register("https", create_wasm_http_transport, nullptr); #endif @@ -14,7 +14,7 @@ wasm_http_transport_scope::wasm_http_transport_scope() wasm_http_transport_scope::~wasm_http_transport_scope() { -#ifdef EMSCRIPTEN +#ifdef __EMSCRIPTEN__ git_transport_unregister("http"); git_transport_unregister("https"); #endif diff --git a/src/wasm/scope.hpp b/src/wasm/scope.hpp index 8eb1c8c..4cff033 100644 --- a/src/wasm/scope.hpp +++ b/src/wasm/scope.hpp @@ -3,7 +3,7 @@ #include "../utils/common.hpp" // Scope object to enable/disable browser-based wasm http transport scheme for libgit2. -// This is a no-op unless EMSCRIPTEN is defined. +// This is a no-op unless __EMSCRIPTEN__ is defined. class wasm_http_transport_scope : noncopyable_nonmovable { public: diff --git a/src/wasm/stream.cpp b/src/wasm/stream.cpp index 67e7e09..959d2bf 100644 --- a/src/wasm/stream.cpp +++ b/src/wasm/stream.cpp @@ -1,4 +1,4 @@ -#ifdef EMSCRIPTEN +#ifdef __EMSCRIPTEN__ # include "stream.hpp" @@ -654,4 +654,4 @@ int wasm_http_stream_write(git_smart_subtransport_stream* s, const char* buffer, return write(stream, buffer, buffer_size); } -#endif // EMSCRIPTEN +#endif // __EMSCRIPTEN__ diff --git a/src/wasm/stream.hpp b/src/wasm/stream.hpp index 712a35a..aaa1b4e 100644 --- a/src/wasm/stream.hpp +++ b/src/wasm/stream.hpp @@ -1,6 +1,6 @@ #pragma once -#ifdef EMSCRIPTEN +#ifdef __EMSCRIPTEN__ # include @@ -43,4 +43,4 @@ int wasm_http_stream_read_response( int wasm_http_stream_write(git_smart_subtransport_stream* s, const char* buffer, size_t buffer_size); -#endif // EMSCRIPTEN +#endif // __EMSCRIPTEN__ diff --git a/src/wasm/subtransport.cpp b/src/wasm/subtransport.cpp index 609f73c..96ba8d4 100644 --- a/src/wasm/subtransport.cpp +++ b/src/wasm/subtransport.cpp @@ -1,4 +1,4 @@ -#ifdef EMSCRIPTEN +#ifdef __EMSCRIPTEN__ # include "subtransport.hpp" @@ -100,4 +100,4 @@ int create_wasm_http_subtransport(git_smart_subtransport** out, git_transport* o return 0; } -#endif // EMSCRIPTEN +#endif // __EMSCRIPTEN__ diff --git a/src/wasm/subtransport.hpp b/src/wasm/subtransport.hpp index 6dd58df..94c1657 100644 --- a/src/wasm/subtransport.hpp +++ b/src/wasm/subtransport.hpp @@ -1,6 +1,6 @@ #pragma once -#ifdef EMSCRIPTEN +#ifdef __EMSCRIPTEN__ # include @@ -24,4 +24,4 @@ struct wasm_http_subtransport // git_smart_subtransport_cb int create_wasm_http_subtransport(git_smart_subtransport** out, git_transport* owner, void* param); -#endif // EMSCRIPTEN +#endif // __EMSCRIPTEN__ diff --git a/src/wasm/transport.cpp b/src/wasm/transport.cpp index 48f5697..e3a7f2f 100644 --- a/src/wasm/transport.cpp +++ b/src/wasm/transport.cpp @@ -1,4 +1,4 @@ -#ifdef EMSCRIPTEN +#ifdef __EMSCRIPTEN__ # include "transport.hpp" @@ -14,4 +14,4 @@ int create_wasm_http_transport(git_transport** out, git_remote* owner, void* par return git_transport_smart(out, owner, &definition); } -#endif // EMSCRIPTEN +#endif // __EMSCRIPTEN__ diff --git a/src/wasm/transport.hpp b/src/wasm/transport.hpp index 93b3fea..33bbe3f 100644 --- a/src/wasm/transport.hpp +++ b/src/wasm/transport.hpp @@ -1,6 +1,6 @@ #pragma once -#ifdef EMSCRIPTEN +#ifdef __EMSCRIPTEN__ # include @@ -8,4 +8,4 @@ // http(s) transport. int create_wasm_http_transport(git_transport** out, git_remote* owner, void* param); -#endif // EMSCRIPTEN +#endif // __EMSCRIPTEN__ diff --git a/src/wasm/utils.cpp b/src/wasm/utils.cpp index 3027326..d81a46f 100644 --- a/src/wasm/utils.cpp +++ b/src/wasm/utils.cpp @@ -1,4 +1,4 @@ -#ifdef EMSCRIPTEN +#ifdef __EMSCRIPTEN__ # include "utils.hpp" @@ -77,4 +77,4 @@ bool maybe_prompt_to_download(double bytes) return true; } -#endif // EMSCRIPTEN +#endif // __EMSCRIPTEN__ diff --git a/src/wasm/utils.hpp b/src/wasm/utils.hpp index ace9191..e4127e4 100644 --- a/src/wasm/utils.hpp +++ b/src/wasm/utils.hpp @@ -1,6 +1,6 @@ #pragma once -#ifdef EMSCRIPTEN +#ifdef __EMSCRIPTEN__ // Get wasm http request timeout in milliseconds from environment variable or default value. unsigned long get_request_timeout_ms(); @@ -9,4 +9,4 @@ unsigned long get_request_timeout_ms(); // May or may not prompt the user for input depending on the size of the download. bool maybe_prompt_to_download(double bytes); -#endif // EMSCRIPTEN +#endif // __EMSCRIPTEN__