Git Product home page Git Product logo

spy's Introduction

SPY Library logo

C++ Informations Broker

CircleCI Build status Licence Discord

Purpose

Detection and versioning of operating systems, compilers, architecture and other element are traditionally done using preprocessor macros. Library like Boost.Predef provides a sanitized interface on top of those but still live in a world where the preprocessor is king.

SPY is a C++17 (and onward) library that gathers similar informations and provides a constexpr compatible interface to access those information, thus making their exploitation within constexpr context possible.

The complete documentation can be found here.

Useful Links

License

This library is licensed under the BOOST Software License as specified in the LICENSE.md file. If you use SPY in your project or product, feel free to send us an email so we can advertise it here.

Boost Software License 1.0

Copyright : SPY Project Contributors

Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the
software and accompanying documentation covered by this license (the "Software") to use, reproduce,
display, distribute, execute, and transmit the Software, and to prepare derivative works of the
Software, and to permit third-parties to whom the Software is furnished to do so, all subject to the
following:

The copyright notices in the Software and this entire statement, including the above license grant,
this restriction and the following disclaimer, must be included in all copies of the Software, in
whole or in part, and all derivative works of the Software, unless such copies or derivative works
are solely in the form of machine-executable object code generated by a source language processor.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT
NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE
BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

spy's People

Contributors

ahoarau avatar jfalcou avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

spy's Issues

Change template parameter naming style to avoid collisions or confusion

Some template parameters have all-caps names such as VERSION or ISA (see include/eve/detail/spy.hpp:764) that:

  • Look like preprocessor variables
  • Are already be defined in some cases

I think it's reasonable to change those names to avoid collisions since VERSION is a commonly defined variable, my suggestion would be to add a prefix like SPY_ or _SPY_ and/or change naming style altogether, as the all caps style might suggest they are preprocessor variables.

ASAN/TSAN detection/support.

I don't know what do you do in SPY and what you don't.

I need a:

  constexpr bool asan_enabled
  constexpr bool tsan_enabled

Maybe

constexpr bool sanitizers_enabled

I also need DISABLE_SAITIZERS macro.

Here is what I wrote to do it (didn't test on MSVC)

#if defined(__has_feature)
#  if __has_feature(address_sanitizer) or __has_feature(thread_sanitizer)
#       define EVE_SANITZERS_ARE_ON
#  endif  // __has_feature
#endif

#if defined(EVE_SANITZERS_ARE_ON)
  constexpr bool sanitizers_are_on = true;

#undef EVE_SANITZERS_ARE_ON

#else
  constexpr bool sanitizers_are_on = false;
#endif

And

#if defined(SPY_COMPILER_IS_CLANG) or defined(SPY_COMPILER_IS_GCC)
#define DISABLE_SANITIZERS __attribute__((no_sanitize_address)) __attribute__((no_sanitize_thread))
#elif defined(SPY_COMPILER_IS_MSVC)
#define DISABLE_SANITIZERS __declspec(no_sanitize_address)
#else
#define DISABLE_SANITIZERS
#endif

Detect __ARM_FEATURE_SVE

The svtbl2 instructions seem to be not on all sve enabled processors, including the ones we care about.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.