function names = extractIntrinsicMacros(h,names)
%

%   Copyright 2014-2020 The MathWorks, Inc.
names = convertStringsToChars(names);

pattern = '(;\s*)|(,\s*)|(\s+)';  % comma/semi-colon followed by >=0 spaces OR >0 spaces
if ischar( names )
    namesBreakdown = regexp( names, pattern, 'split' );
    if isempty( namesBreakdown )
        names = cell( names );
    else
        names = namesBreakdown;
    end
elseif ~iscell( names )  %% ~iscellstr(value)
    error( message( 'coder_compile:toolchain:IncorrectIntrinsicMacrosFormat' ) )
end
for i = 1:numel( names )
    if ~isempty( names{ i } )
        namesBreakdown = regexp( names{ i }, pattern, 'split' );
        numNames = numel( namesBreakdown );
        if numNames>1
            names{ i } = [  ];
            names = horzcat( names, namesBreakdown );  %#ok<AGROW>
        end
    end
end
names = coder.make.ToolchainInfo.removeEmptyCellElements( names );
end
