Skip to content

Commit

Permalink
Try reduce min OTP version
Browse files Browse the repository at this point in the history
  • Loading branch information
williamthome committed Aug 4, 2024
1 parent 7f4f552 commit e5abc35
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

strategy:
matrix:
otp-version: [25, 26, 27]
otp-version: [24, 25, 26, 27]
os: [ubuntu-24.04]

steps:
Expand Down
2 changes: 1 addition & 1 deletion rebar.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{minimum_otp_vsn, "25"}.
%{minimum_otp_vsn, "25"}.

{erl_opts, [
debug_info,
Expand Down
5 changes: 5 additions & 0 deletions src/euneus_encoder.erl
Original file line number Diff line number Diff line change
Expand Up @@ -493,8 +493,13 @@ encode_term(Term, Encode, State) ->
encode_integer(Int, _Encode, _State) ->
erlang:integer_to_binary(Int, 10).

-if(?OTP_RELEASE >= 25).
encode_float(Float, _Encode, _State) ->
erlang:float_to_binary(Float, [short]).
-else.
encode_float(Float, _Encode, _State) ->
iolist_to_binary(io_lib_format:fwrite_g(Float)).
-endif.

encode_atom(true, _Encode, _State) ->
<<"true">>;
Expand Down

0 comments on commit e5abc35

Please sign in to comment.