Skip to content

Commit 3a67b0b

Browse files
committed
rtapi: stop exporting the vsnprintf implementation
rtapi_vsnprintf.h is 475 lines of implementation, not an interface, and the only code that includes it is rtai_rtapi.c beside it and the unit test. The documented entry point, rtapi_vsnprintf(), is declared in rtapi.h and stays exported, so nothing an out-of-tree component may legitimately call moves. The header goes to rtapi/ and rtai_rtapi.c takes it from its own directory. The three exported headers it pulls in go angled, since they are no longer beside it. tests/rtapi_printf.0 compiles the header, so it now needs the source tree and is skipped on installed packages, the same way tests/blendmath already is.
1 parent cd3913c commit 3a67b0b

4 files changed

Lines changed: 9 additions & 5 deletions

File tree

src/rtapi/rtai_rtapi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373

7474
#include <linux/cpumask.h> /* NR_CPUS, cpu_online() */
7575

76-
#include <rtapi_vsnprintf.h>
76+
#include "rtapi_vsnprintf.h"
7777

7878
#include <rtai.h>
7979
#include <rtai_sched.h>
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ values (or floating point).
3838

3939
#include <stdarg.h>
4040
#include <stddef.h>
41-
#include "rtapi_ctype.h"
42-
#include "rtapi_math.h"
43-
#include "rtapi_string.h"
41+
#include <rtapi_ctype.h>
42+
#include <rtapi_math.h>
43+
#include <rtapi_string.h>
4444

4545
/* we use this so that we can do without the string library */
4646
static int strn_len(const char *s, int count)

tests/rtapi_printf.0/skip

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
# This test compiles rtapi_vsnprintf.h from the source tree, which is only
3+
# available in run-in-place builds. Skip when testing installed packages.
4+
[ -z "$SYSTEM_BUILD" ]

tests/rtapi_printf.0/test.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash -xe
22

3-
g++ -DULAPI -I"${HEADERS}" -std=c++0x \
3+
g++ -DULAPI -I"${EMC2_HOME}/src/rtapi" -I"${HEADERS}" -std=c++0x \
44
-DSIM -rdynamic -L"${LIBDIR}" \
55
-o test_rtapi_vsnprintf test_rtapi_vsnprintf.c
66
./test_rtapi_vsnprintf

0 commit comments

Comments
 (0)