From 3788f9e739b8468e35a772c501f990f7d8309adb Mon Sep 17 00:00:00 2001 From: Lukas Larsson Date: Tue, 5 Jul 2011 11:21:21 +0200 Subject: Add support for nif option to optimized PER asn1 compilation --- lib/asn1/src/asn1ct_gen_per_rt2ct.erl | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'lib/asn1/src/asn1ct_gen_per_rt2ct.erl') diff --git a/lib/asn1/src/asn1ct_gen_per_rt2ct.erl b/lib/asn1/src/asn1ct_gen_per_rt2ct.erl index 4f4fcfafc3..417a47849f 100644 --- a/lib/asn1/src/asn1ct_gen_per_rt2ct.erl +++ b/lib/asn1/src/asn1ct_gen_per_rt2ct.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2002-2010. All Rights Reserved. +%% Copyright Ericsson AB 2002-2011. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -224,13 +224,18 @@ gen_encode_prim(Erules,D,DoTag,Value) when is_record(D,type) -> emit(["?RT_PER:encode_open_type(", {asis,Constraint}, ",", Value, ")"]); 'ASN1_OPEN_TYPE' -> + Nif = lists:member(nif,get(encoding_options)) andalso + lists:member(optimize,get(encoding_options)), NewValue = case Constraint of [#'Externaltypereference'{type=Tname}] -> io_lib:format( - "?RT_PER:complete(enc_~s(~s))",[Tname,Value]); + "?RT_PER:complete(enc_~s(~s)"++ + [",nif" || Nif == true]++")",[Tname,Value]); [#type{def=#'Externaltypereference'{type=Tname}}] -> io_lib:format( - "?RT_PER:complete(enc_~s(~s))",[Tname,Value]); + "?RT_PER:complete(enc_~s(~s)"++ + [",nif" || Nif == true]++")", + [Tname,Value]); _ -> Value end, emit(["?RT_PER:encode_open_type(", {asis,Constraint}, ",", -- cgit v1.2.3