From a3e0a87d951b1323ca542c9b115d5525d0d022c9 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 6 Jun 2013 17:58:28 -0400 Subject: Completely refactor how FILENAME_PRIVATE works We previously used FILENAME_PRIVATE identifiers mostly for identifiers exposed only to the unit tests... but also for identifiers exposed to the benchmarker, and sometimes for identifiers exposed to a similar module, and occasionally for no really good reason at all. Now, we use FILENAME_PRIVATE identifiers for identifiers shared by Tor and the unit tests. They should be defined static when we aren't building the unit test, and globally visible otherwise. (The STATIC macro will keep us honest here.) For identifiers used only by the unit tests and never by Tor at all, on the other hand, we wrap them in #ifdef TOR_UNIT_TESTS. This is not the motivating use case for the split test/non-test build system; it's just a test example to see how it works, and to take a chance to clean up the code a little. --- src/or/buffers.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/or/buffers.c') diff --git a/src/or/buffers.c b/src/or/buffers.c index c4c847ec8..cc5890416 100644 --- a/src/or/buffers.c +++ b/src/or/buffers.c @@ -1294,7 +1294,7 @@ buf_matches_at_pos(const buf_pos_t *pos, const char *s, size_t n) /** Return the first position in buf at which the n-character * string s occurs, or -1 if it does not occur. */ -/*private*/ int +STATIC int buf_find_string_offset(const buf_t *buf, const char *s, size_t n) { buf_pos_t pos; -- cgit v1.2.3