function fidCheck(fid, fcnname)
%MATLAB Code Generation Private Function

% Common checks for fid parameters.
%   Copyright 2013-2014 The MathWorks, Inc.
%#codegen
coder.inline('always');
coder.internal.prefer_const(fid,fcnname);
eml_transient;
eml_invariant(eml_is_const(size(fid)), ...
                      'Coder:toolbox:xprintfFixedSzFid', upper(fcnname), ...
                      'IfNotConst', 'Fail');
eml_invariant(isa(fid, 'double') && isscalar(fid) && isreal(fid), ... 
                      'MATLAB:FileIO:InvalidFid', ...
                      'IfNotConst', 'Fail');
