% Utility for building Target Function Libraries

% Copyright 2011-2012 The MathWorks, Inc.
%
% Create the Simulation Targets instance of the BLAS library
%  
function da = data_align_specification(compiler)

  da = [];
  switch compiler
  
     case 'MSVC'
          as = RTW.AlignmentSpecification;
          as.AlignmentType = { 'DATA_ALIGNMENT_GLOBAL_VAR',  ...
                               'DATA_ALIGNMENT_LOCAL_VAR', ...
                               'DATA_ALIGNMENT_WHOLE_STRUCT', ...
                               'DATA_ALIGNMENT_STRUCT_FIELD'};
          as.AlignmentSyntaxTemplate = '__declspec(align(%n))';
          as.SupportedLanguages={'c', 'c++'};
          da = RTW.DataAlignment;  
          da.addAlignmentSpecification(as);
          
      case 'GCC'          
          as = RTW.AlignmentSpecification;
          as.AlignmentSyntaxTemplate = '__attribute((aligned(%n)))';
          as.AlignmentType = { 'DATA_ALIGNMENT_LOCAL_VAR', ...
                               'DATA_ALIGNMENT_GLOBAL_VAR', ...
                               'DATA_ALIGNMENT_STRUCT_FIELD'};
          as.SupportedLanguages={'c', 'c++'};
          da = RTW.DataAlignment;
          da.addAlignmentSpecification(as);
          
          as = RTW.AlignmentSpecification;
          as.AlignmentType = {'DATA_ALIGNMENT_WHOLE_STRUCT'};
          as.AlignmentSyntaxTemplate = '__attribute((aligned(%n)))';
          as.AlignmentPosition = 'DATA_ALIGNMENT_POSTDIRECTIVE';
          as.SupportedLanguages={'c', 'c++'};
          da.addAlignmentSpecification(as);          
          
  end  
 
