is64bit.m: test the operating system, not MATLAB’s index size

Closes: #41
parent d6c536f5
function b = is64bit()
% Returns true iff Matlab 64bit version is used.
% Returns true iff operating system is 64-bit
%
% The test logic is the same as in dynare.m when selecting the preprocessor
% flavour.
% Copyright (C) 2017 Dynare Team
% Copyright (C) 2017-2019 Dynare Team
%
% This code is free software: you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
......@@ -17,5 +20,10 @@ function b = is64bit()
% You should have received a copy of the GNU General Public License
% along with Dynare. If not, see <http://www.gnu.org/licenses/>.
[~, maxsize] = computer();
b = (maxsize > 2^31);
\ No newline at end of file
if ispc
arch = getenv('PROCESSOR_ARCHITECTURE');
else
[~, arch] = system('uname -m');
end
b = ~isempty(strfind(arch, '64'));
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment