Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions example/derived-type_diagnostic.F90
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,12 @@ pure module function construct(z) result(new_stuff_t)

contains

module procedure defined
pure module function defined(self) result(self_defined)
class(stuff_t), intent(in) :: self
logical self_defined

self_defined = self%defined_
end procedure
end function

module procedure construct
new_stuff_t%z_ = z
Expand Down Expand Up @@ -103,12 +106,15 @@ pure module function construct(stuff) result(new_characterizable_stuff)

contains

module procedure as_character
pure module function as_character(self) result(character_self)
class(characterizable_stuff_t), intent(in) :: self
character(len=:), allocatable :: character_self

integer, parameter :: max_len=256
character(len=max_len) untrimmed_string
write(untrimmed_string,*) self%stuff_%z()
character_self = trim(adjustl(untrimmed_string))
end procedure
end function

module procedure construct
new_characterizable_stuff%stuff_ = stuff
Expand Down
2 changes: 1 addition & 1 deletion include/assert_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
! Deal with stringification issues:
! https://gcc.gnu.org/legacy-ml/fortran/2009-06/msg00131.html
#ifndef STRINGIFY
# if defined(__GFORTRAN__) || defined(_CRAYFTN)
# if defined(__GFORTRAN__) || defined(_CRAYFTN) || defined(NAGFOR)
# define STRINGIFY(x) "x"
# else
# define STRINGIFY(x) #x
Expand Down