Skip to content

Commit bacfa42

Browse files
go
1 parent f9e8210 commit bacfa42

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

inst/tinytest/test_libtcc.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ expect_true(tcc_symbol_is_valid(sym_ptr))
2222

2323
# Debug: print symbol pointer address and alignment (always enabled)
2424
addr <- get_external_ptr_addr(sym_ptr)
25-
cat(sprintf("[RTINYCC_DEBUG] symbol 'forty_two' address: 0x%x\n", addr))
26-
cat(sprintf("[RTINYCC_DEBUG] address %% 8: %d\n", addr %% 8))
25+
cat(sprintf("[RTINYCC_DEBUG] symbol 'forty_two' address: %f\n", addr))
26+
cat(sprintf("[RTINYCC_DEBUG] address %% 8: %f\n", addr %% 8))
2727

2828
# CLI compile to object
2929
src <- system.file("c_examples", "forty_two.c", package = "Rtinycc")

src/init.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ SEXP RC_libtcc_call_symbol(SEXP ext, SEXP name, SEXP ret_type);
1212
SEXP RC_libtcc_get_symbol(SEXP ext, SEXP name);
1313
SEXP RC_libtcc_call_symbol_typed(SEXP ext, SEXP name, SEXP ret_type);
1414
SEXP RC_libtcc_ptr_valid(SEXP ptr);
15+
SEXP RC_get_external_ptr_addr(SEXP ext);
1516

1617
// .Call entries
1718
static const R_CallMethodDef CallEntries[] = {
@@ -23,6 +24,7 @@ static const R_CallMethodDef CallEntries[] = {
2324
{"RC_libtcc_call_symbol", (DL_FUNC) &RC_libtcc_call_symbol, 3},
2425
{"RC_libtcc_get_symbol", (DL_FUNC) &RC_libtcc_get_symbol, 2},
2526
{"RC_libtcc_ptr_valid", (DL_FUNC) &RC_libtcc_ptr_valid, 1},
27+
{"RC_get_external_ptr_addr", (DL_FUNC) &RC_get_external_ptr_addr, 1},
2628
{NULL, NULL, 0}
2729
};
2830

0 commit comments

Comments
 (0)