Skip to content

Commit

Permalink
fix: fail compilation on non-64-bit systems
Browse files Browse the repository at this point in the history
  • Loading branch information
sdbondi committed Mar 10, 2023
1 parent c9d355b commit ed4cda0
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 0 deletions.
10 changes: 10 additions & 0 deletions applications/tari_app_utilities/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,13 @@ pub mod consts {
// Import the auto-generated const values from the Manifest and Git
include!(concat!(env!("OUT_DIR"), "/consts.rs"));
}

/// Non-64-bit architectures are untested. Depending on the application, it may not compile already or could be various
/// classes of bugs (overflows, crashes, etc). Use this macro to explicitly fail compilation on non-64-bit targets.
#[macro_export]
macro_rules! deny_non_64_bit_archs {
() => {
#[cfg(not(target_pointer_width = "64"))]
compile_error!("Only 64-bit architectures are supported");
};
}
3 changes: 3 additions & 0 deletions applications/tari_base_node/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

// non-64-bit not supported
tari_app_utilities::deny_non_64_bit_archs!();

#[macro_use]
mod table;

Expand Down
3 changes: 3 additions & 0 deletions applications/tari_console_wallet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

// non-64-bit not supported
tari_app_utilities::deny_non_64_bit_archs!();

mod automation;
mod cli;
mod config;
Expand Down
3 changes: 3 additions & 0 deletions applications/tari_merge_mining_proxy/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

// non-64-bit not supported
tari_app_utilities::deny_non_64_bit_archs!();

mod block_template_data;
mod block_template_protocol;
mod cli;
Expand Down
3 changes: 3 additions & 0 deletions applications/tari_miner/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
// USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

// non-64-bit not supported
tari_app_utilities::deny_non_64_bit_archs!();

mod cli;
pub use cli::Cli;
use tari_common::exit_codes::ExitError;
Expand Down

0 comments on commit ed4cda0

Please sign in to comment.