Skip to content

Commit fbaacc9

Browse files
committed
use if cascade
1 parent 59da998 commit fbaacc9

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

src/stdlib_system.F90

+7-12
Original file line numberDiff line numberDiff line change
@@ -523,40 +523,34 @@ integer function get_runtime_os() result(os)
523523
if (index(val, 'linux') > 0) then
524524
os = OS_LINUX
525525
return
526-
end if
527526

528527
! macOS
529-
if (index(val, 'darwin') > 0) then
528+
elseif (index(val, 'darwin') > 0) then
530529
os = OS_MACOS
531530
return
532-
end if
533531

534532
! Windows, MSYS, MinGW, Git Bash
535-
if (index(val, 'win') > 0 .or. index(val, 'msys') > 0) then
533+
elseif (index(val, 'win') > 0 .or. index(val, 'msys') > 0) then
536534
os = OS_WINDOWS
537535
return
538-
end if
539536

540537
! Cygwin
541-
if (index(val, 'cygwin') > 0) then
538+
elseif (index(val, 'cygwin') > 0) then
542539
os = OS_CYGWIN
543540
return
544-
end if
545541

546542
! Solaris, OpenIndiana, ...
547-
if (index(val, 'SunOS') > 0 .or. index(val, 'solaris') > 0) then
543+
elseif (index(val, 'SunOS') > 0 .or. index(val, 'solaris') > 0) then
548544
os = OS_SOLARIS
549545
return
550-
end if
551546

552547
! FreeBSD
553-
if (index(val, 'FreeBSD') > 0 .or. index(val, 'freebsd') > 0) then
548+
elseif (index(val, 'FreeBSD') > 0 .or. index(val, 'freebsd') > 0) then
554549
os = OS_FREEBSD
555550
return
556-
end if
557551

558552
! OpenBSD
559-
if (index(val, 'OpenBSD') > 0 .or. index(val, 'openbsd') > 0) then
553+
elseif (index(val, 'OpenBSD') > 0 .or. index(val, 'openbsd') > 0) then
560554
os = OS_OPENBSD
561555
return
562556
end if
@@ -593,6 +587,7 @@ integer function get_runtime_os() result(os)
593587
os = OS_FREEBSD
594588
return
595589
end if
590+
596591
end function get_runtime_os
597592

598593
!> Retrieves the cached OS type for minimal runtime overhead.

0 commit comments

Comments
 (0)