Просмотр исходного кода

Fix compilation issue on older Erlang releases.

If `binary_to_float` is not exported, the compiler thinks we are
calling a local function, which fails to compile.
Andreas Stenius 11 лет назад
Родитель
Сommit
c7627394fe
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      src/erlydtl_filters.erl

+ 2 - 2
src/erlydtl_filters.erl

@@ -723,10 +723,10 @@ cast_to_float(Input) when is_binary(Input) ->
     %% be compatible with releases prior to R16B
     case erlang:function_exported(erlang, binary_to_float, 1) of
         true ->
-            try binary_to_float(Input)
+            try erlang:binary_to_float(Input)
             catch
                 error:_Reason ->
-                    binary_to_integer(Input) + 0.0
+                    erlang:binary_to_integer(Input) + 0.0
             end;
         false ->
             cast_to_float(binary_to_list(Input))