Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/utils/config_overrides.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "config_overrides.hpp"

#ifdef EMSCRIPTEN
#ifdef __EMSCRIPTEN__
# include <iterator>

# include <git2/sys/config.h>
Expand All @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions src/wasm/libgit2_internals.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifdef EMSCRIPTEN
#ifdef __EMSCRIPTEN__

# include "libgit2_internals.hpp"

Expand Down Expand Up @@ -63,4 +63,4 @@ std::optional<http_service> select_service(git_smart_service_t action)
return std::nullopt;
}

#endif // EMSCRIPTEN
#endif // __EMSCRIPTEN__
4 changes: 2 additions & 2 deletions src/wasm/libgit2_internals.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#ifdef EMSCRIPTEN
#ifdef __EMSCRIPTEN__

# include <optional>
# include <string>
Expand Down Expand Up @@ -63,4 +63,4 @@ std::string name_for_method(git_http_method method);

std::optional<http_service> select_service(git_smart_service_t action);

#endif // EMSCRIPTEN
#endif // __EMSCRIPTEN__
4 changes: 2 additions & 2 deletions src/wasm/read_buffer.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifdef EMSCRIPTEN
#ifdef __EMSCRIPTEN__

# include "read_buffer.hpp"

Expand All @@ -9,4 +9,4 @@ read_buffer_t::read_buffer_t(char* buffer, size_t buffer_size, size_t* bytes_rea
{
}

#endif // EMSCRIPTEN
#endif // __EMSCRIPTEN__
4 changes: 2 additions & 2 deletions src/wasm/read_buffer.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#ifdef EMSCRIPTEN
#ifdef __EMSCRIPTEN__

# include <stddef.h>

Expand All @@ -15,4 +15,4 @@ struct read_buffer_t
size_t* m_bytes_read;
};

#endif // EMSCRIPTEN
#endif // __EMSCRIPTEN__
4 changes: 2 additions & 2 deletions src/wasm/response.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifdef EMSCRIPTEN
#ifdef __EMSCRIPTEN__

# include "response.hpp"

Expand Down Expand Up @@ -82,4 +82,4 @@ void wasm_http_response::set_git_error(std::string_view url) const
);
}

#endif // EMSCRIPTEN
#endif // __EMSCRIPTEN__
4 changes: 2 additions & 2 deletions src/wasm/response.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#ifdef EMSCRIPTEN
#ifdef __EMSCRIPTEN__

# include <map>
# include <optional>
Expand Down Expand Up @@ -40,4 +40,4 @@ class wasm_http_response
std::multimap<const std::string, const std::string> m_response_headers;
};

#endif // EMSCRIPTEN
#endif // __EMSCRIPTEN__
6 changes: 3 additions & 3 deletions src/wasm/scope.cpp
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
#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
}

wasm_http_transport_scope::~wasm_http_transport_scope()
{
#ifdef EMSCRIPTEN
#ifdef __EMSCRIPTEN__
git_transport_unregister("http");
git_transport_unregister("https");
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/wasm/scope.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions src/wasm/stream.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifdef EMSCRIPTEN
#ifdef __EMSCRIPTEN__

# include "stream.hpp"

Expand Down Expand Up @@ -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__
4 changes: 2 additions & 2 deletions src/wasm/stream.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#ifdef EMSCRIPTEN
#ifdef __EMSCRIPTEN__

# include <git2/sys/transport.h>

Expand Down Expand Up @@ -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__
4 changes: 2 additions & 2 deletions src/wasm/subtransport.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifdef EMSCRIPTEN
#ifdef __EMSCRIPTEN__

# include "subtransport.hpp"

Expand Down Expand Up @@ -100,4 +100,4 @@ int create_wasm_http_subtransport(git_smart_subtransport** out, git_transport* o
return 0;
}

#endif // EMSCRIPTEN
#endif // __EMSCRIPTEN__
4 changes: 2 additions & 2 deletions src/wasm/subtransport.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#pragma once

#ifdef EMSCRIPTEN
#ifdef __EMSCRIPTEN__

# include <string>

Expand All @@ -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__
4 changes: 2 additions & 2 deletions src/wasm/transport.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifdef EMSCRIPTEN
#ifdef __EMSCRIPTEN__

# include "transport.hpp"

Expand All @@ -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__
4 changes: 2 additions & 2 deletions src/wasm/transport.hpp
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#pragma once

#ifdef EMSCRIPTEN
#ifdef __EMSCRIPTEN__

# include <git2/sys/transport.h>

// Callback of type git_transport_cb that is registered with libgit2 and is called to handle
// http(s) transport.
int create_wasm_http_transport(git_transport** out, git_remote* owner, void* param);

#endif // EMSCRIPTEN
#endif // __EMSCRIPTEN__
4 changes: 2 additions & 2 deletions src/wasm/utils.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#ifdef EMSCRIPTEN
#ifdef __EMSCRIPTEN__

# include "utils.hpp"

Expand Down Expand Up @@ -77,4 +77,4 @@ bool maybe_prompt_to_download(double bytes)
return true;
}

#endif // EMSCRIPTEN
#endif // __EMSCRIPTEN__
4 changes: 2 additions & 2 deletions src/wasm/utils.hpp
Original file line number Diff line number Diff line change
@@ -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();
Expand All @@ -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__
Loading