Skip to content

Commit

Permalink
Check for little endian in extconf.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
peterzhu2118 committed Jan 11, 2021
1 parent 75f1c8f commit f26621c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions ext/liquid_c/extconf.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# frozen_string_literal: true
require 'mkmf'

# if system endianness == network endianness (big endian)
if [1].pack('I') == [1].pack('N')
raise 'System incompatible with liquid-c, only little endian systems supported'
end

$CFLAGS << ' -std=c11 -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers'
append_cflags('-fvisibility=hidden')
# In Ruby 2.6 and earlier, the Ruby headers did not have struct timespec defined
Expand Down

0 comments on commit f26621c

Please sign in to comment.