Skip to content

Commit

Permalink
hashlib: only include in one place
Browse files Browse the repository at this point in the history
  • Loading branch information
widlarizer committed Oct 18, 2024
1 parent 1bfddea commit 6a570b3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 2 additions & 0 deletions kernel/hashlib.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ namespace hashlib {
* Hashlib doesn't know how to hash silly Yosys-specific types.
* Hashlib doesn't depend on Yosys and can be used standalone.
* Please don't use hashlib standalone for new projects.
* Never directly include kernel/hashlib.h in Yosys code.
* Instead include kernel/yosys_common.h
*
* The hash_ops type is now always left to its default value, derived
* from templated functions through SFINAE. Providing custom ops is
Expand Down
3 changes: 1 addition & 2 deletions kernel/yosys_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,7 @@ YOSYS_NAMESPACE_BEGIN
// Note: All headers included in hashlib.h must be included
// outside of YOSYS_NAMESPACE before this or bad things will happen.
#ifdef HASHLIB_H
# undef HASHLIB_H
# include "kernel/hashlib.h"
# error You've probably included hashlib.h under two namespace paths. Bad idea.

Check warning on line 160 in kernel/yosys_common.h

View workflow job for this annotation

GitHub Actions / test-compile (ubuntu-latest, gcc-10)

missing terminating ' character

Check warning on line 160 in kernel/yosys_common.h

View workflow job for this annotation

GitHub Actions / test-compile (ubuntu-latest, gcc-10)

missing terminating ' character

Check warning on line 160 in kernel/yosys_common.h

View workflow job for this annotation

GitHub Actions / test-compile (ubuntu-latest, gcc-10)

missing terminating ' character

Check warning on line 160 in kernel/yosys_common.h

View workflow job for this annotation

GitHub Actions / test-compile (ubuntu-latest, gcc-10)

missing terminating ' character

Check warning on line 160 in kernel/yosys_common.h

View workflow job for this annotation

GitHub Actions / test-compile (ubuntu-latest, gcc)

missing terminating ' character

Check warning on line 160 in kernel/yosys_common.h

View workflow job for this annotation

GitHub Actions / test-compile (ubuntu-latest, gcc)

missing terminating ' character

Check warning on line 160 in kernel/yosys_common.h

View workflow job for this annotation

GitHub Actions / test-compile (ubuntu-latest, gcc)

missing terminating ' character

Check warning on line 160 in kernel/yosys_common.h

View workflow job for this annotation

GitHub Actions / test-compile (ubuntu-latest, gcc)

missing terminating ' character

Check warning on line 160 in kernel/yosys_common.h

View workflow job for this annotation

GitHub Actions / test-compile (ubuntu-latest, gcc)

missing terminating ' character

Check warning on line 160 in kernel/yosys_common.h

View workflow job for this annotation

GitHub Actions / test-compile (ubuntu-latest, gcc)

missing terminating ' character

Check warning on line 160 in kernel/yosys_common.h

View workflow job for this annotation

GitHub Actions / test-compile (ubuntu-latest, gcc)

missing terminating ' character

Check warning on line 160 in kernel/yosys_common.h

View workflow job for this annotation

GitHub Actions / test-compile (ubuntu-latest, gcc)

missing terminating ' character
#else
# include "kernel/hashlib.h"
# undef HASHLIB_H
Expand Down
1 change: 0 additions & 1 deletion passes/cmds/rename.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
#include "kernel/register.h"
#include "kernel/rtlil.h"
#include "kernel/log.h"
#include "kernel/hashlib.h"

USING_YOSYS_NAMESPACE
PRIVATE_NAMESPACE_BEGIN
Expand Down

0 comments on commit 6a570b3

Please sign in to comment.