Skip to content

Commit

Permalink
Non-legacy headers shouldn't be including legacy api headers
Browse files Browse the repository at this point in the history
  • Loading branch information
woodfell committed Nov 23, 2023
1 parent 1220a7b commit b30d570
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/c.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ jobs:
sudo apt-get -qq install gcc-multilib-mips-linux-gnu gcc-mips-linux-gnu qemu-user g++-mips-linux-gnu
- name: Run big endian tests
run: make test-c-v4
run: make test-c
env:
CC: mips-linux-gnu-gcc
CXX: mips-linux-gnu-g++
Expand Down
1 change: 0 additions & 1 deletion c/include/libsbp/cpp/state.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

#include <libsbp/sbp.h>
#include <libsbp/cpp/message_traits.h>
#include <libsbp/legacy/compat.h>

namespace sbp {

Expand Down
1 change: 1 addition & 0 deletions c/include/libsbp/legacy/cpp/legacy_state.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#define SBP_LEGACY_CPP_LEGACY_STATE_H

#include <libsbp/cpp/state.h>
#include <libsbp/legacy/compat.h>

SBP_MESSAGE(
"The legacy libsbp API has been deprecated. This file and all symbols contained will "
Expand Down
10 changes: 9 additions & 1 deletion c/test/check_sbp.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,18 @@
*/

#include <check.h>
#include <libsbp/legacy/compat.h>
#include <sbp.h>
#include <stdio.h>

// Obviously we don't normally want to silence this message, but we also need to
// still test the legacy implementation for as long as it exists. By silencing
// these messages here we can get a less noisy build in libsbp
#ifdef SBP_MESSAGE
#undef SBP_MESSAGE
#define SBP_MESSAGE(x)
#endif
#include <libsbp/legacy/compat.h>

int DUMMY_MEMORY_FOR_CALLBACKS = (int)0xdeadbeef;
int DUMMY_MEMORY_FOR_IO = (int)0xdead0000;

Expand Down

0 comments on commit b30d570

Please sign in to comment.