Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined: _cxgo_offsetof #83

Open
BrownNPC opened this issue Jan 14, 2025 · 0 comments
Open

undefined: _cxgo_offsetof #83

BrownNPC opened this issue Jan 14, 2025 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@BrownNPC
Copy link

BrownNPC commented Jan 14, 2025

I was trying to compile clay.h but the compiled code is calling this _cxgo_offsetof() function. for example
_cxgo_offsetof(Clay__Alignbool{}, "#member"))), arena))}

Steps to reproduce:

  1. Download clay.h with debug tooling disabled
  2. make a clay.c file with the following content:
#define CLAY_IMPLEMENTATION
#include "clay.h"
  1. Run cxgo file clay.c
  2. grep for _cxgo_offsetof for example on line 730:
func Clay__BoolArray_Allocate_Arena(capacity int32, arena *Clay_Arena) Clay__BoolArray {
	return Clay__BoolArray{capacity: capacity, length: 0, internalArray: (*bool)(Clay__Array_Allocate_Arena(capacity, uint32(unsafe.Sizeof(bool(false))), uint32(int32(_cxgo_offsetof(Clay__Alignbool{}, "#member"))), arena))}
}

here is the C code for the function:

Clay__BoolArray Clay__BoolArray_Allocate_Arena(int32_t capacity, Clay_Arena *arena) {
    return CLAY__INIT(Clay__BoolArray){.capacity = capacity, .length = 0, .internalArray = (bool *)Clay__Array_Allocate_Arena(capacity, sizeof(bool), CLAY__ALIGNMENT(bool), arena)};
}
@dennwc dennwc self-assigned this Jan 14, 2025
@dennwc dennwc added the bug Something isn't working label Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants