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

Private external symbols experiment #248

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
20 changes: 20 additions & 0 deletions sxbp/sxbp_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,26 @@
extern "C" {
#endif

// these concatenation macros are needed to properly concatenate other macros
#define CAT(prefix, major, minor, patch, symbol) CAT_(prefix, major, minor, patch, symbol)
#define CAT_(prefix, major, minor, patch, symbol) prefix ## _ ## major ## minor ## patch ## _ ## symbol
// a cheap "private" symbol generator, which uses version number as a prefix
#define SXBP_PRIVATE(symbol) CAT(SXBP_PRIVATE, SXBP_VERSION_MAJOR, SXBP_VERSION_MINOR, SXBP_VERSION_PATCH, symbol)

// the following symbols need to be external, but "private"
#define SXBP_VECTOR_DIRECTIONS SXBP_PRIVATE(VECTOR_DIRECTIONS)
#define sxbp_update_bounds SXBP_PRIVATE(update_bounds)
#define sxbp_move_location SXBP_PRIVATE(move_location)
#define sxbp_move_location_along_line SXBP_PRIVATE(move_location_along_line)
#define sxbp_get_bounds SXBP_PRIVATE(get_bounds)
#define sxbp_get_origin_from_bounds SXBP_PRIVATE(get_origin_from_bounds)
#define sxbp_walk_figure SXBP_PRIVATE(walk_figure)
#define sxbp_get_size_from_bounds SXBP_PRIVATE(get_size_from_bounds)
#define sxbp_dimension_to_string SXBP_PRIVATE(dimension_to_string)
#define sxbp_make_bitmap_for_bounds SXBP_PRIVATE(make_bitmap_for_bounds)
#define sxbp_print_bitmap SXBP_PRIVATE(print_bitmap)
#define sxbp_refine_figure_shrink_from_end SXBP_PRIVATE(refine_figure_shrink_from_end)

// private type for storing one of the items of a tuple
typedef int32_t sxbp_tuple_item_t;

Expand Down