function tool = getMacro(h,name)
%

%   Copyright 2014-2020 The MathWorks, Inc.

narginchk( 2, 2 );
name = convertStringsToChars(name);
if ~ischar( name )
    error( message( 'coder_compile:toolchain:MacroInputNotAString' ) )
end
try
    tool = h.Macros.getValue( name );
catch exc
    if ~h.Macros.isKey( name )
        error( message( 'coder_compile:toolchain:CannotSetNonexistentMacro', name ) )
    else
        rethrow( exc )
    end
end
end
