Two WebARKitLog.h headers share the include guard WEBARKIT_LOG_H
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 70/100
Research direction
The two headers are include/WebARKit/WebARKitLog.h and WebARKit/include/WebARKitLog.h, and both open with the same WEBARKIT_LOG_H guard. Compare them, then check the matching implementations in lib/SRC/WebARKit/WebARKitLog.cpp and WebARKit/WebARKitLog.cpp. Done means each header has its own guard and a translation unit that includes both compiles. Pick the guard-rename fix or the convergence option with a maintainer, since the issue leaves that choice open.
Written by the indexing model from the issue text.
Description
Description
WebARKitLib has two different logging headers with the same include guard:
| header | API | depends on |
|---|---|---|
include/WebARKit/WebARKitLog.h |
webarkitLOGi/e(const std::string&, …) overloads, implemented in lib/SRC/WebARKit/WebARKitLog.cpp |
<emscripten.h>, unconditionally |
WebARKit/include/WebARKitLog.h |
ARUtil-style webarkitLog() with WEBARKIT_LOGd/i/w/e macros and webarkitLogLevel, implemented in WebARKit/WebARKitLog.cpp |
none, native-compatible |
Both start with:
#ifndef WEBARKIT_LOG_H
#define WEBARKIT_LOG_H
so a translation unit that includes both gets only the first one. Code that uses the other logger then fails to compile, because its functions or macros are undeclared. The two implementations define different symbols, so they do link together.
Why it matters now
The planned ARToolKitNFTCore (webarkit/jsartoolkitNFT#683) has to compile natively, so it will log through WebARKit/include/WebARKitLog.h. The jsartoolkitNFT Embind adapters keep using include/WebARKit/WebARKitLog.h. The design works around the clash: the core includes its logger only in .cpp files, never in a public header. That is a rule to remember rather than a guarantee.
Possible fixes
- Give each header its own guard (e.g.
WEBARKIT_LOG_EM_Hfor the Emscripten one), or - make
include/WebARKit/WebARKitLog.hinclude<emscripten.h>only under#ifdef __EMSCRIPTEN__and converge on one logger.
Refs webarkit/jsartoolkitNFT#683.
- Dominant language
- C++
- Stars
- 21
- Forks
- 8
- Avg merge
- 2h 59m
- Merged PRs (30d)
- 12
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from webarkit/WebARKitLib
-
C/C++ code enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
webarkit/WebARKitLib#83 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
webarkit/WebARKitLib#70 ·
Maintainers usually reply within 1 day
-
Real-world pose scale from a physical marker width at init (ArtoolkitX-style), not the _pattern.size/2 pixel centre offsetMay be free again @kalwalt claimed this 96 days ago, and no pull request is open. Openenhancement question
webarkit/WebARKitLib#62 · 1 assignee ·
Maintainers usually reply within 1 day
-
Difficulty 5/5 Over a week Newbie friendliness 20/100
webarkit/WebARKitLib#48 ·
Maintainers usually reply within 1 day
-
Extends ColorSpace to new format (BGR, BGRA...)May be free again @kalwalt claimed this 1063 days ago, and no pull request is open. OpenC/C++ code enhancement
webarkit/WebARKitLib#25 · 1 assignee ·
Maintainers usually reply within 1 day
All issues in webarkit/WebARKitLib
Similar issues
-
bug product: very_good_flutter_plugin
Difficulty 1/5 1-3 hours Newbie friendliness 78/100
VeryGoodOpenSource/very_good_templates#654 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
rr-debugger/rr#4111 ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 62/100
tenstorrent/ttsim#30 ·