Skip to content

Commit

Permalink
Fix up two different C problems.
Browse files Browse the repository at this point in the history
The first one was that the visibility_control file was
marked as a C++ header, but was included in a C header.
Avoid that by just making visibility_control a C header.

The second problem is that, in C, a function with no
arguments technically takes "any" arguments.  Fix
ros_trace_compile_status() to have void arguments, which
ensures that no arguments can be passed.

Signed-off-by: Chris Lalancette <[email protected]>
  • Loading branch information
clalancette committed Aug 2, 2024
1 parent 409ae64 commit 7952cbc
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tracetools/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ set(SOURCES
set(HEADERS
include/${PROJECT_NAME}/tracetools.h
include/${PROJECT_NAME}/utils.hpp
include/${PROJECT_NAME}/visibility_control.hpp
include/${PROJECT_NAME}/visibility_control.h
)
if(NOT TRACETOOLS_TRACEPOINTS_EXCLUDED)
# We only need these if we're using LTTng
Expand Down
4 changes: 2 additions & 2 deletions tracetools/include/tracetools/tracetools.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include <stdbool.h>

#include "tracetools/config.h"
#include "tracetools/visibility_control.hpp"
#include "tracetools/visibility_control.h"

#ifndef TRACETOOLS_DISABLED
/**
Expand Down Expand Up @@ -134,7 +134,7 @@ extern "C"
/**
* \return `true` if tracing is enabled, `false` otherwise
*/
TRACETOOLS_PUBLIC bool ros_trace_compile_status();
TRACETOOLS_PUBLIC bool ros_trace_compile_status(void);

/// `rcl_init`
/**
Expand Down
2 changes: 1 addition & 1 deletion tracetools/src/tracetools.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
}
// *INDENT-ON*

bool ros_trace_compile_status()
bool ros_trace_compile_status(void)
{
#ifndef TRACETOOLS_TRACEPOINTS_EXCLUDED
return true;
Expand Down

0 comments on commit 7952cbc

Please sign in to comment.