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

Fix include c2a-core v4 #519

Merged
merged 3 commits into from
Oct 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/components/real/cdh/on_board_computer_with_c2a.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@
#ifdef USE_C2A
#include "src_core/c2a_core_main.h"

#if C2A_CORE_VER_MAJOR == 4
#if !defined(C2A_CORE_VER_MAJOR)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

C2A_CORE_VER_MAJOR が常に定義されていればこれでよい(そしてそうあるべき)のだが,よく考えると C2A_CORE_VER_MAJORv3.5.0 で入れたものなので,この対応だと v3.0.0 ~ v3.4.0 に対して breaking となってしまう

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

そしてこのファイル,もしかしてUSE_C2A=OFF でもビルドされてる?(なのでこの PR の CI 落ちてる)

Copy link
Collaborator Author

@sksat sksat Oct 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not defined な時は #warning に変えた: f639d33

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

これらのファイルは USE_C2A=ON の時のみビルドすべきでは?というのは #520 でやる(breaking change になってしまうし)

#warning "C2A_CORE_VER_MAJOR is not defined" # this flag is defined after c2a-core v3.5.0
#elif C2A_CORE_VER_MAJOR == 4
// c2a-core v4
#include "src_core/system/task_manager/task_dispatcher.h"
#include "src_core/system/time_manager/time_manager.h"
Expand All @@ -22,7 +24,6 @@
#else
#error "c2a-core version is not supported"
#endif // c2a-core version header

#endif // USE_C2A

std::map<int, UartPort*> ObcWithC2a::com_ports_c2a_;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@
#include <regex>

#ifdef USE_C2A
#if C2A_CORE_VER_MAJOR == 4
#include "src_core/c2a_core_main.h"
#if !defined(C2A_CORE_VER_MAJOR)
#warning "C2A_CORE_VER_MAJOR is not defined" # this flag is defined after c2a-core v3.5.0
#elif C2A_CORE_VER_MAJOR == 4
// c2a-core v4
#include "src_core/tlm_cmd/common_cmd_packet_util.h"
#elif C2A_CORE_VER_MAJOR <= 3
Expand Down