Browse Source

Merge pull request #19 from zmstone/master

No -dialyzer spec for pre-18 OTP releases
Takeru Ohta 8 years ago
parent
commit
210ef7e35b
3 changed files with 5 additions and 2 deletions
  1. 2 1
      rebar.config
  2. 1 1
      src/jsone.app.src
  3. 2 0
      src/jsone_encode.erl

+ 2 - 1
rebar.config

@@ -4,7 +4,8 @@
             warn_export_all,
             warn_untyped_record,
             inline,
-            {platform_define, "^R[01][0-9]", 'NO_MAP_TYPE'}
+            {platform_define, "^R[01][0-9]", 'NO_MAP_TYPE'},
+            {platform_define, "(^R|17)", 'NO_DIALYZER_SPEC'}
            ]}.
 
 {xref_checks, [

+ 1 - 1
src/jsone.app.src

@@ -1,6 +1,6 @@
 {application,jsone,
              [{description,"Erlang JSON Library"},
-              {vsn,"1.4.0"},
+              {vsn,"1.4.1"},
               {registered,[]},
               {applications,[kernel,stdlib]},
               {maintainers,["Takeru Ohta"]},

+ 2 - 0
src/jsone_encode.erl

@@ -157,7 +157,9 @@ datetime({{Y,M,D}, {H,Mi,S}}, Nexts, Buf, Opt) when ?IS_DATETIME(Y,M,D,H,Mi,S) -
 datetime(Datetime, Nexts, Buf, Opt) ->
     ?ERROR(datetime, [Datetime, Nexts, Buf, Opt]).
 
+-ifndef(NO_DIALYZER_SPEC).
 -dialyzer({no_improper_lists, [format_year/1]}).
+-endif.
 -spec format_year(non_neg_integer()) -> iodata().
 format_year(Y) when Y > 999 -> integer_to_binary(Y);
 format_year(Y) ->