cgltf icon indicating copy to clipboard operation
cgltf copied to clipboard

To support file-local usage with 'static' (no 'extern') functions

Open hu-xd opened this issue 1 year ago • 0 comments

Please support single-file include mode without expose any 'extern' symbols to avoid conflicts in static-lib/wasm scenarios.

currently most of cgltf_* functions are declared using 'extern' which will expose the functions to other compilation units. but in some scenarios like static-library or large webassembly/emscripten projects with many independently developed modules, this may introduce conflicts/duplicated symbols.

stb_ libraries uses a macro like STB_IMAGE_STATIC to switch between 'extern'/'static' functions, hopefully cgltf can support this too. https://github.com/nothings/stb/blob/013ac3beddff3dbffafd5177e7972067cd2b5083/stb_image.h#L395C8-L395C24

hu-xd avatar Sep 06 '24 03:09 hu-xd