aboutsummaryrefslogtreecommitdiffstats
path: root/lib/asn1/src/asn1ct_gen.erl
diff options
context:
space:
mode:
authorLukas Larsson <[email protected]>2011-07-05 11:21:50 +0200
committerLukas Larsson <[email protected]>2011-08-01 16:38:00 +0200
commitfd79e047602c87ebaa9b86c0d2937b399555a836 (patch)
tree9575adb222fc26fab983ea90e063f872a122ff07 /lib/asn1/src/asn1ct_gen.erl
parent3788f9e739b8468e35a772c501f990f7d8309adb (diff)
downloadotp-fd79e047602c87ebaa9b86c0d2937b399555a836.tar.gz
otp-fd79e047602c87ebaa9b86c0d2937b399555a836.tar.bz2
otp-fd79e047602c87ebaa9b86c0d2937b399555a836.zip
Add support for nif option to optimized ber_bin_v2 asn1 compilation
Diffstat (limited to 'lib/asn1/src/asn1ct_gen.erl')
-rw-r--r--lib/asn1/src/asn1ct_gen.erl15
1 files changed, 5 insertions, 10 deletions
diff --git a/lib/asn1/src/asn1ct_gen.erl b/lib/asn1/src/asn1ct_gen.erl
index e7f59c3d3c..74faade1cf 100644
--- a/lib/asn1/src/asn1ct_gen.erl
+++ b/lib/asn1/src/asn1ct_gen.erl
@@ -1134,12 +1134,7 @@ gen_decode_partial_incomplete(Erule) when Erule == ber;Erule==ber_bin;
"Data) of",nl]),
EmitCaseClauses(),
emit(["decode_part(Type,Data0) ->",nl]),
- Driver =
- case lists:member(driver,get(encoding_options)) of
- true ->
- ",driver";
- _ -> ""
- end,
+ Driver = driver_parameter(),
emit([" case catch decode_inc_disp(Type,element(1,?RT_BER:decode(Data0",Driver,"))) of",nl]),
% " {Data,_RestBin} = ?RT_BER:decode(Data0),",nl,
% " case catch decode_inc_disp(Type,Data) of",nl]),
@@ -1185,10 +1180,10 @@ gen_partial_inc_dispatcher([],_) ->
driver_parameter() ->
Options = get(encoding_options),
- case lists:member(driver,Options) of
- true ->
- ",driver";
- _ -> ""
+ case {lists:member(driver,Options),lists:member(nif,Options)} of
+ {true,_} -> ",driver";
+ {_,true} -> ",nif";
+ _ -> ""
end.
gen_wrapper() ->