Skip to content

Target/based include may get messy #93

@bryanwjy

Description

@bryanwjy

Currently many parts of the library have public headers that include private target dependent headers like the following:

#define UTL_FUTEX_PRIVATE_HEADER_GUARD
#if UTL_TARGET_LINUX
#  include "utl/atomic/linux/utl_futex.h"
#elif UTL_TARGET_APPLE
#  include "utl/atomic/apple/utl_futex.h"
#elif UTL_TARGET_MICROSOFT
#  include "utl/atomic/winapi/utl_futex.h"
#elif UTL_TARGET_BSD
#  include "utl/atomic/bsd/utl_futex.h"
// TODO: Non-native futex
#else
#  error Unsupported platform
#endif
#undef UTL_FUTEX_PRIVATE_HEADER_GUARD

The problem is that, many of the posix-based targets may partially share APIs, this could get quite messy over time. Investigate if there's a better way.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions