elf_hashtable_checks.hpp 425 B

123456789101112131415161718
  1. /**
  2. * Check for multiple entries with the same hash value at compilation time.
  3. */
  4. #pragma once
  5. #include <array>
  6. #include "elf_hashtable_entry.h"
  7. template <std::size_t N>
  8. constexpr bool has_hash_collisions(const std::array<sym_entry, N> api_methods) {
  9. for(std::size_t i = 0; i < (N - 1); ++i) {
  10. if(api_methods[i].hash == api_methods[i + 1].hash) {
  11. return true;
  12. }
  13. }
  14. return false;
  15. }