Skip to content

Commit 0e8d1c2

Browse files
committed
Check for little endian in extconf.rb
1 parent af0b2bb commit 0e8d1c2

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

ext/liquid_c/extconf.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# frozen_string_literal: true
22
require 'mkmf'
3+
4+
# if system endianness == network endianness (big endian)
5+
if [1].pack('I') == [1].pack('N')
6+
raise 'System incompatible with liquid-c, only little endian systems supported'
7+
end
8+
39
$CFLAGS << ' -std=c11 -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers'
410
append_cflags('-fvisibility=hidden')
511
# In Ruby 2.6 and earlier, the Ruby headers did not have struct timespec defined

0 commit comments

Comments
 (0)