@@ -65,6 +65,17 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */
6565#define STAT_STOPPED_IMAGE 6000
6666#define STAT_FAILED_IMAGE 6001
6767
68+ #ifdef GCC_GE_15
69+ /* Definitions of the Fortran 2018 standard; need to kept in sync with
70+ ISO_FORTRAN_ENV, cf. gcc/fortran/libgfortran.h. */
71+ typedef enum
72+ {
73+ CAF_INITIAL_TEAM = 0 ,
74+ CAF_PARENT_TEAM ,
75+ CAF_CURRENT_TEAM
76+ } caf_team_level_t ;
77+ #endif
78+
6879/* Describes what type of array we are registerring. Keep in sync with
6980 gcc/fortran/trans.h. */
7081typedef enum caf_register_t
@@ -88,24 +99,12 @@ typedef enum caf_deregister_t
8899 CAF_DEREGTYPE_COARRAY_DEALLOCATE_ONLY
89100} caf_deregister_t ;
90101
102+ /** The opaque type to represent a coarray token. */
91103typedef void * caf_token_t ;
92- /** Add a dummy type representing teams in coarrays. */
93104
105+ /** The opaque type for teams. */
94106typedef void * caf_team_t ;
95107
96- typedef struct caf_teams_list
97- {
98- caf_team_t team ;
99- int team_id ;
100- struct caf_teams_list * prev ;
101- } caf_teams_list ;
102-
103- typedef struct caf_used_teams_list
104- {
105- struct caf_teams_list * team_list_elem ;
106- struct caf_used_teams_list * prev ;
107- } caf_used_teams_list ;
108-
109108/* When there is a vector subscript in this dimension, nvec == 0, otherwise,
110109 lower_bound, upper_bound, stride contains the bounds relative to the declared
111110 bounds; kind denotes the integer kind of the elements of vector[]. */
@@ -238,8 +237,15 @@ bool PREFIX(is_contiguous)(gfc_descriptor_t *);
238237void PREFIX (init )(int * , char * * * );
239238void PREFIX (finalize )(void );
240239
240+ #ifdef GCC_GE_15
241+ int PREFIX (this_image )(caf_team_t );
242+
243+ int PREFIX (num_images )(caf_team_t , int32_t * );
244+ #else
241245int PREFIX (this_image )(int );
246+
242247int PREFIX (num_images )(int , int );
248+ #endif
243249
244250#ifdef GCC_GE_7
245251void PREFIX (register)(size_t , caf_register_t , caf_token_t * , gfc_descriptor_t * ,
@@ -359,11 +365,20 @@ void PREFIX(error_stop)(int QUIETARG) __attribute__((noreturn));
359365
360366void PREFIX (fail_image )(void ) __attribute__((noreturn ));
361367
368+ #ifdef GCC_GE_15
369+ void PREFIX (form_team )(int , caf_team_t * , int * , int * , char * , charlen_t );
370+ void PREFIX (change_team )(caf_team_t , int * , char * , charlen_t );
371+ void PREFIX (end_team )(int * , char * , charlen_t );
372+ void PREFIX (sync_team )(caf_team_t , int * , char * , charlen_t );
373+ int PREFIX (team_number )(caf_team_t );
374+ caf_team_t PREFIX (get_team )(int32_t * );
375+ #else
362376void PREFIX (form_team )(int , caf_team_t * , int );
363377void PREFIX (change_team )(caf_team_t * , int );
364378void PREFIX (end_team )(caf_team_t * );
365379void PREFIX (sync_team )(caf_team_t * , int );
366380int PREFIX (team_number )(caf_team_t * );
381+ #endif
367382
368383int PREFIX (image_status )(int );
369384void PREFIX (failed_images )(gfc_descriptor_t * , int , int * );
0 commit comments