Skip to content

Commit

Permalink
feat(arc): add optional arg for filename in gscobj header (#153)
Browse files Browse the repository at this point in the history
  • Loading branch information
ineedbots authored Oct 2, 2023
1 parent 898e575 commit 834e402
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion include/xsk/arc/assembler.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class assembler

public:
assembler(context const* ctx);
auto assemble(assembly const& data) -> buffer;
auto assemble(assembly const& data, std::string const& name = {}) -> buffer;

private:
auto assemble_function(function& func) -> void;
Expand Down
6 changes: 3 additions & 3 deletions src/arc/assembler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ assembler::assembler(context const* ctx) : ctx_{ ctx }, script_{ ctx->endian() =
{
}

auto assembler::assemble(assembly const& data) -> buffer
auto assembler::assemble(assembly const& data, std::string const& name) -> buffer
{
assembly_ = &data;
script_.clear();
Expand All @@ -26,7 +26,7 @@ auto assembler::assemble(assembly const& data) -> buffer
auto head = header{};

script_.pos((ctx_->props() & props::headerxx) ? 0 : (ctx_->props() & props::header72) ? 72 : 64);
process_string("");
process_string(name);

for (auto const& func : assembly_->functions)
{
Expand Down Expand Up @@ -183,7 +183,7 @@ auto assembler::assemble(assembly const& data) -> buffer
head.profile_count = 0;

head.flags = 0;
head.name = resolve_string("");
head.name = resolve_string(name);

auto endpos = script_.pos();

Expand Down

0 comments on commit 834e402

Please sign in to comment.