Actual source code: fortranimpl.h

  1: /* This file contains info for the use of PETSc Fortran interface stubs */
  2: #pragma once

  4: #include <petsc/private/petscimpl.h>
  5: PETSC_INTERN PetscErrorCode PETScParseFortranArgs_Private(int *, char ***);
  6: PETSC_EXTERN PetscErrorCode PetscMPIFortranDatatypeToC(MPI_Fint, MPI_Datatype *);

  8: PETSC_EXTERN PetscErrorCode PetscScalarAddressToFortran(PetscObject, PetscInt, PetscScalar *, PetscScalar *, PetscInt, size_t *);
  9: PETSC_EXTERN PetscErrorCode PetscScalarAddressFromFortran(PetscObject, PetscScalar *, size_t, PetscInt, PetscScalar **);
 10: PETSC_EXTERN size_t         PetscIntAddressToFortran(const PetscInt *, const PetscInt *);
 11: PETSC_EXTERN PetscInt      *PetscIntAddressFromFortran(const PetscInt *, size_t);
 12: PETSC_EXTERN char          *PETSC_NULL_CHARACTER_Fortran;
 13: PETSC_EXTERN void          *PETSC_NULL_INTEGER_Fortran;
 14: PETSC_EXTERN void          *PETSC_NULL_SCALAR_Fortran;
 15: PETSC_EXTERN void          *PETSC_NULL_DOUBLE_Fortran;
 16: PETSC_EXTERN void          *PETSC_NULL_REAL_Fortran;
 17: PETSC_EXTERN void          *PETSC_NULL_BOOL_Fortran;
 18: PETSC_EXTERN void          *PETSC_NULL_ENUM_Fortran;
 19: PETSC_EXTERN void          *PETSC_NULL_INTEGER_ARRAY_Fortran;
 20: PETSC_EXTERN void          *PETSC_NULL_SCALAR_ARRAY_Fortran;
 21: PETSC_EXTERN void          *PETSC_NULL_REAL_ARRAY_Fortran;
 22: PETSC_EXTERN void          *PETSC_NULL_MPI_COMM_Fortran;
 23: PETSC_EXTERN void (*PETSC_NULL_FUNCTION_Fortran)(void);

 25: PETSC_INTERN PetscErrorCode PetscInitFortran_Private(PetscBool, const char *, PetscInt);

 27: /*  ----------------------------------------------------------------------*/
 28: /*
 29:    PETSc object C pointers are stored directly as
 30:    Fortran integer*4 or *8 depending on the size of pointers.
 31: */

 33: /* --------------------------------------------------------------------*/
 34: /*
 35:     Since Fortran does not null terminate strings we need to insure the string is null terminated before passing it
 36:     to C. This may require a memory allocation which is then freed with FREECHAR().
 37: */
 38: #define FIXCHAR(a, n, b) \
 39:   do { \
 40:     if ((a) == PETSC_NULL_CHARACTER_Fortran) { \
 41:       (b) = (a) = PETSC_NULLPTR; \
 42:     } else { \
 43:       while (((n) > 0) && ((a)[(n) - 1] == ' ')) (n)--; \
 44:       *ierr = PetscMalloc1((n) + 1, &(b)); \
 45:       if (*ierr) return; \
 46:       *ierr  = PetscMemcpy((b), (a), (n)); \
 47:       (b)[n] = '\0'; \
 48:       if (*ierr) return; \
 49:     } \
 50:   } while (0)
 51: #define FREECHAR(a, b) \
 52:   do { \
 53:     if (a != b) *ierr = PetscFree(b); \
 54:   } while (0)

 56: /*
 57:     Fortran expects any unneeded characters at the end of its strings to be filled with the blank character.
 58: */
 59: #define FIXRETURNCHAR(flg, a, n) \
 60:   do { \
 61:     if (flg) { \
 62:       PETSC_FORTRAN_CHARLEN_T __i; \
 63:       for (__i = 0; __i < n && a[__i] != 0; __i++) { }; \
 64:       for (; __i < n; __i++) a[__i] = ' '; \
 65:     } \
 66:   } while (0)

 68: /*
 69:     The cast through PETSC_UINTPTR_T is so that compilers that warn about casting to/from void * to void(*)(void)
 70:     will not complain about these comparisons. It is not know if this works for all compilers
 71: */
 72: #define FORTRANNULLINTEGER(a)   (((void *)(PETSC_UINTPTR_T)a) == PETSC_NULL_INTEGER_Fortran || ((void *)(PETSC_UINTPTR_T)a) == PETSC_NULL_INTEGER_ARRAY_Fortran)
 73: #define FORTRANNULLSCALAR(a)    (((void *)(PETSC_UINTPTR_T)a) == PETSC_NULL_SCALAR_Fortran || ((void *)(PETSC_UINTPTR_T)a) == PETSC_NULL_SCALAR_ARRAY_Fortran)
 74: #define FORTRANNULLREAL(a)      (((void *)(PETSC_UINTPTR_T)a) == PETSC_NULL_REAL_Fortran || ((void *)(PETSC_UINTPTR_T)a) == PETSC_NULL_REAL_ARRAY_Fortran)
 75: #define FORTRANNULLDOUBLE(a)    (((void *)(PETSC_UINTPTR_T)a) == PETSC_NULL_DOUBLE_Fortran)
 76: #define FORTRANNULLBOOL(a)      (((void *)(PETSC_UINTPTR_T)a) == PETSC_NULL_BOOL_Fortran)
 77: #define FORTRANNULLENUM(a)      (((void *)(PETSC_UINTPTR_T)a) == PETSC_NULL_ENUM_Fortran)
 78: #define FORTRANNULLCHARACTER(a) (((void *)(PETSC_UINTPTR_T)a) == PETSC_NULL_CHARACTER_Fortran)
 79: #define FORTRANNULLFUNCTION(a)  (((void (*)(void))(PETSC_UINTPTR_T)a) == PETSC_NULL_FUNCTION_Fortran)
 80: #define FORTRANNULLOBJECT(a)    (*(void **)(PETSC_UINTPTR_T)a == (void *)0)
 81: #define FORTRANNULLMPICOMM(a)   (((void *)(PETSC_UINTPTR_T)a) == PETSC_NULL_MPI_COMM_Fortran)

 83: /*
 84:     A Fortran object with a value of (void*) 0 corresponds to a NULL object in C and is indicated in Fortran by PETSC_NULL_XXXX
 85:     A Fortran object with a value of (void*) -2 is an object that was never created or was destroyed (see checkFortranTypeInitialize()).
 86:     A Fortran object with a value of (void*) -3 happens when a PETSc routine returns in one of its arguments a NULL object
 87:     (it cannot return a value of (void*) 0 because if later the returned variable is passed to a creation routine,
 88:     it would think one has passed in a PETSC_NULL_XXX and error).

 90:     This is needed because Fortran always uses pass by reference so one cannot pass a NULL address, only an address with special
 91:     values at the location.
 92: */

 94: #define CHKFORTRANNULL(a) \
 95:   do { \
 96:     if (FORTRANNULLINTEGER(a) || FORTRANNULLENUM(a) || FORTRANNULLDOUBLE(a) || FORTRANNULLSCALAR(a) || FORTRANNULLREAL(a) || FORTRANNULLBOOL(a) || FORTRANNULLFUNCTION(a) || FORTRANNULLCHARACTER(a) || FORTRANNULLMPICOMM(a)) { a = PETSC_NULLPTR; } \
 97:   } while (0)

 99: #define CHKFORTRANNULLINTEGER(a) \
100:   do { \
101:     if (FORTRANNULLINTEGER(a) || FORTRANNULLENUM(a)) { \
102:       a = PETSC_NULLPTR; \
103:     } else if (FORTRANNULLDOUBLE(a) || FORTRANNULLSCALAR(a) || FORTRANNULLREAL(a) || FORTRANNULLBOOL(a) || FORTRANNULLFUNCTION(a) || FORTRANNULLCHARACTER(a) || FORTRANNULLMPICOMM(a)) { \
104:       *ierr = PetscError(PETSC_COMM_SELF, __LINE__, PETSC_FUNCTION_NAME, __FILE__, PETSC_ERR_ARG_WRONG, PETSC_ERROR_INITIAL, "Use PETSC_NULL_INTEGER"); \
105:       *ierr = PETSC_ERR_ARG_BADPTR; \
106:       return; \
107:     } \
108:   } while (0)

110: #define CHKFORTRANNULLSCALAR(a) \
111:   do { \
112:     if (FORTRANNULLSCALAR(a)) { \
113:       a = PETSC_NULLPTR; \
114:     } else if (FORTRANNULLINTEGER(a) || FORTRANNULLDOUBLE(a) || FORTRANNULLREAL(a) || FORTRANNULLBOOL(a) || FORTRANNULLFUNCTION(a) || FORTRANNULLCHARACTER(a) || FORTRANNULLMPICOMM(a)) { \
115:       *ierr = PetscError(PETSC_COMM_SELF, __LINE__, PETSC_FUNCTION_NAME, __FILE__, PETSC_ERR_ARG_WRONG, PETSC_ERROR_INITIAL, "Use PETSC_NULL_SCALAR"); \
116:       *ierr = PETSC_ERR_ARG_BADPTR; \
117:       return; \
118:     } \
119:   } while (0)

121: #define CHKFORTRANNULLDOUBLE(a) \
122:   do { \
123:     if (FORTRANNULLDOUBLE(a)) { \
124:       a = PETSC_NULLPTR; \
125:     } else if (FORTRANNULLINTEGER(a) || FORTRANNULLSCALAR(a) || FORTRANNULLREAL(a) || FORTRANNULLBOOL(a) || FORTRANNULLFUNCTION(a) || FORTRANNULLCHARACTER(a) || FORTRANNULLMPICOMM(a)) { \
126:       *ierr = PetscError(PETSC_COMM_SELF, __LINE__, PETSC_FUNCTION_NAME, __FILE__, PETSC_ERR_ARG_WRONG, PETSC_ERROR_INITIAL, "Use PETSC_NULL_DOUBLE"); \
127:       *ierr = PETSC_ERR_ARG_BADPTR; \
128:       return; \
129:     } \
130:   } while (0)

132: #define CHKFORTRANNULLREAL(a) \
133:   do { \
134:     if (FORTRANNULLREAL(a)) { \
135:       a = PETSC_NULLPTR; \
136:     } else if (FORTRANNULLINTEGER(a) || FORTRANNULLDOUBLE(a) || FORTRANNULLSCALAR(a) || FORTRANNULLBOOL(a) || FORTRANNULLFUNCTION(a) || FORTRANNULLCHARACTER(a) || FORTRANNULLMPICOMM(a)) { \
137:       *ierr = PetscError(PETSC_COMM_SELF, __LINE__, PETSC_FUNCTION_NAME, __FILE__, PETSC_ERR_ARG_WRONG, PETSC_ERROR_INITIAL, "Use PETSC_NULL_REAL"); \
138:       *ierr = PETSC_ERR_ARG_BADPTR; \
139:       return; \
140:     } \
141:   } while (0)

143: #define CHKFORTRANNULLOBJECT(a) \
144:   do { \
145:     if (!(*(void **)a)) { \
146:       a = PETSC_NULLPTR; \
147:     } else if (FORTRANNULLINTEGER(a) || FORTRANNULLDOUBLE(a) || FORTRANNULLSCALAR(a) || FORTRANNULLREAL(a) || FORTRANNULLBOOL(a) || FORTRANNULLFUNCTION(a) || FORTRANNULLCHARACTER(a) || FORTRANNULLMPICOMM(a)) { \
148:       *ierr = PetscError(PETSC_COMM_SELF, __LINE__, PETSC_FUNCTION_NAME, __FILE__, PETSC_ERR_ARG_WRONG, PETSC_ERROR_INITIAL, "Use PETSC_NULL_XXX where XXX is the name of a particular object class"); \
149:       *ierr = PETSC_ERR_ARG_BADPTR; \
150:       return; \
151:     } \
152:   } while (0)

154: #define CHKFORTRANNULLBOOL(a) \
155:   do { \
156:     if (FORTRANNULLBOOL(a)) { \
157:       a = PETSC_NULLPTR; \
158:     } else if (FORTRANNULLSCALAR(a) || FORTRANNULLINTEGER(a) || FORTRANNULLDOUBLE(a) || FORTRANNULLSCALAR(a) || FORTRANNULLREAL(a) || FORTRANNULLFUNCTION(a) || FORTRANNULLCHARACTER(a) || FORTRANNULLMPICOMM(a)) { \
159:       *ierr = PetscError(PETSC_COMM_SELF, __LINE__, PETSC_FUNCTION_NAME, __FILE__, PETSC_ERR_ARG_WRONG, PETSC_ERROR_INITIAL, "Use PETSC_NULL_BOOL"); \
160:       *ierr = PETSC_ERR_ARG_BADPTR; \
161:       return; \
162:     } \
163:   } while (0)

165: #define CHKFORTRANNULLFUNCTION(a) \
166:   do { \
167:     if (FORTRANNULLFUNCTION(a)) { \
168:       a = PETSC_NULLPTR; \
169:     } else if (FORTRANNULLOBJECT(a) || FORTRANNULLSCALAR(a) || FORTRANNULLDOUBLE(a) || FORTRANNULLREAL(a) || FORTRANNULLINTEGER(a) || FORTRANNULLBOOL(a) || FORTRANNULLCHARACTER(a) || FORTRANNULLMPICOMM(a)) { \
170:       *ierr = PetscError(PETSC_COMM_SELF, __LINE__, PETSC_FUNCTION_NAME, __FILE__, PETSC_ERR_ARG_WRONG, PETSC_ERROR_INITIAL, "Use PETSC_NULL_FUNCTION"); \
171:       *ierr = PETSC_ERR_ARG_BADPTR; \
172:       return; \
173:     } \
174:   } while (0)

176: #define CHKFORTRANNULLMPICOMM(a) \
177:   do { \
178:     if (FORTRANNULLMPICOMM(a)) { \
179:       a = PETSC_NULLPTR; \
180:     } else if (FORTRANNULLINTEGER(a) || FORTRANNULLDOUBLE(a) || FORTRANNULLSCALAR(a) || FORTRANNULLREAL(a) || FORTRANNULLBOOL(a) || FORTRANNULLFUNCTION(a) || FORTRANNULLCHARACTER(a)) { \
181:       *ierr = PetscError(PETSC_COMM_SELF, __LINE__, PETSC_FUNCTION_NAME, __FILE__, PETSC_ERR_ARG_WRONG, PETSC_ERROR_INITIAL, "Use PETSC_NULL_MPI_COMM"); \
182:       *ierr = PETSC_ERR_ARG_BADPTR; \
183:       return; \
184:     } \
185:   } while (0)

187: /* In the beginning of Fortran XxxCreate() ensure object is not NULL or already created */
188: #define PETSC_FORTRAN_OBJECT_CREATE(a) \
189:   do { \
190:     if (!(*(void **)a)) { \
191:       *ierr = PetscError(PETSC_COMM_SELF, __LINE__, PETSC_FUNCTION_NAME, __FILE__, PETSC_ERR_ARG_WRONG, PETSC_ERROR_INITIAL, "Cannot create PETSC_NULL_XXX object"); \
192:       *ierr = PETSC_ERR_ARG_WRONG; \
193:       return; \
194:     } else if (*((void **)(a)) != (void *)-2 && *((void **)(a)) != (void *)-3) { \
195:       *ierr = PetscError(PETSC_COMM_SELF, __LINE__, PETSC_FUNCTION_NAME, __FILE__, PETSC_ERR_ARG_WRONG, PETSC_ERROR_INITIAL, "Cannot create already existing object"); \
196:       *ierr = PETSC_ERR_ARG_WRONG; \
197:       return; \
198:     } \
199:   } while (0)

201: /*
202:   In the beginning of Fortran XxxDestroy(a), if the input object was destroyed, change it to a petsc C NULL object so that it won't crash C XxxDestory()
203:   If it is PETSC_NULL_XXX just return since these objects cannot be destroyed
204: */
205: #define PETSC_FORTRAN_OBJECT_F_DESTROYED_TO_C_NULL(a) \
206:   do { \
207:     if (!*(void **)a || *((void **)(a)) == (void *)-2 || *((void **)(a)) == (void *)-3) { \
208:       *ierr = PETSC_SUCCESS; \
209:       return; \
210:     } \
211:   } while (0)

213: /* After C XxxDestroy(a) is called, change a's state from NULL to destroyed, so that it can be used/destroyed again by Fortran.
214:    E.g., in VecScatterCreateToAll(x,vscat,seq,ierr), if seq = PETSC_NULL_VEC, petsc won't create seq. But if seq is a
215:    destroyed object (e.g., as a result of a previous Fortran VecDestroy), petsc will create seq.
216: */
217: #define PETSC_FORTRAN_OBJECT_C_NULL_TO_F_DESTROYED(a) \
218:   do { \
219:     *((void **)(a)) = (void *)-2; \
220:   } while (0)

222: /*
223:     Variable type where we stash PETSc object pointers in Fortran.
224: */
225: typedef PETSC_UINTPTR_T PetscFortranAddr;

227: /*
228:     These are used to support the default viewers that are
229:   created at run time, in C using the , trick.

231:     The numbers here must match the numbers in include/petsc/finclude/petscsys.h
232: */
233: #define PETSC_VIEWER_DRAW_WORLD_FORTRAN   4
234: #define PETSC_VIEWER_DRAW_SELF_FORTRAN    5
235: #define PETSC_VIEWER_SOCKET_WORLD_FORTRAN 6
236: #define PETSC_VIEWER_SOCKET_SELF_FORTRAN  7
237: #define PETSC_VIEWER_STDOUT_WORLD_FORTRAN 8
238: #define PETSC_VIEWER_STDOUT_SELF_FORTRAN  9
239: #define PETSC_VIEWER_STDERR_WORLD_FORTRAN 10
240: #define PETSC_VIEWER_STDERR_SELF_FORTRAN  11
241: #define PETSC_VIEWER_BINARY_WORLD_FORTRAN 12
242: #define PETSC_VIEWER_BINARY_SELF_FORTRAN  13
243: #define PETSC_VIEWER_MATLAB_WORLD_FORTRAN 14
244: #define PETSC_VIEWER_MATLAB_SELF_FORTRAN  15

246: #include <petscviewer.h>

248: static inline PetscViewer PetscPatchDefaultViewers(PetscViewer *v)
249: {
250:   if (!v) return PETSC_NULLPTR;
251:   if (!(*(void **)v)) return PETSC_NULLPTR;
252:   switch (*(PetscFortranAddr *)v) {
253:   case PETSC_VIEWER_DRAW_WORLD_FORTRAN:
254:     return PETSC_VIEWER_DRAW_WORLD;
255:   case PETSC_VIEWER_DRAW_SELF_FORTRAN:
256:     return PETSC_VIEWER_DRAW_SELF;

258:   case PETSC_VIEWER_STDOUT_WORLD_FORTRAN:
259:     return PETSC_VIEWER_STDOUT_WORLD;
260:   case PETSC_VIEWER_STDOUT_SELF_FORTRAN:
261:     return PETSC_VIEWER_STDOUT_SELF;

263:   case PETSC_VIEWER_STDERR_WORLD_FORTRAN:
264:     return PETSC_VIEWER_STDERR_WORLD;
265:   case PETSC_VIEWER_STDERR_SELF_FORTRAN:
266:     return PETSC_VIEWER_STDERR_SELF;

268:   case PETSC_VIEWER_BINARY_WORLD_FORTRAN:
269:     return PETSC_VIEWER_BINARY_WORLD;
270:   case PETSC_VIEWER_BINARY_SELF_FORTRAN:
271:     return PETSC_VIEWER_BINARY_SELF;

273: #if defined(PETSC_HAVE_MATLAB)
274:   case PETSC_VIEWER_MATLAB_SELF_FORTRAN:
275:     return PETSC_VIEWER_MATLAB_SELF;
276:   case PETSC_VIEWER_MATLAB_WORLD_FORTRAN:
277:     return PETSC_VIEWER_MATLAB_WORLD;
278: #endif

280: #if defined(PETSC_USE_SOCKET_VIEWER)
281:   case PETSC_VIEWER_SOCKET_WORLD_FORTRAN:
282:     return PETSC_VIEWER_SOCKET_WORLD;
283:   case PETSC_VIEWER_SOCKET_SELF_FORTRAN:
284:     return PETSC_VIEWER_SOCKET_SELF;
285: #endif

287:   default:
288:     return *v;
289:   }
290: }

292: #if defined(PETSC_USE_SOCKET_VIEWER)
293:   #define PetscPatchDefaultViewers_Fortran_Socket(vin, v) \
294:     } \
295:     else if ((*(PetscFortranAddr *)vin) == PETSC_VIEWER_SOCKET_WORLD_FORTRAN) \
296:     { \
297:       v = PETSC_VIEWER_SOCKET_WORLD; \
298:     } \
299:     else if ((*(PetscFortranAddr *)vin) == PETSC_VIEWER_SOCKET_SELF_FORTRAN) \
300:     { \
301:       v = PETSC_VIEWER_SOCKET_SELF
302: #else
303:   #define PetscPatchDefaultViewers_Fortran_Socket(vin, v)
304: #endif

306: #define PetscPatchDefaultViewers_Fortran(vin, v) \
307:   do { \
308:     if ((*(PetscFortranAddr *)vin) == PETSC_VIEWER_DRAW_WORLD_FORTRAN) { \
309:       v = PETSC_VIEWER_DRAW_WORLD; \
310:     } else if ((*(PetscFortranAddr *)vin) == PETSC_VIEWER_DRAW_SELF_FORTRAN) { \
311:       v = PETSC_VIEWER_DRAW_SELF; \
312:     } else if ((*(PetscFortranAddr *)vin) == PETSC_VIEWER_STDOUT_WORLD_FORTRAN) { \
313:       v = PETSC_VIEWER_STDOUT_WORLD; \
314:     } else if ((*(PetscFortranAddr *)vin) == PETSC_VIEWER_STDOUT_SELF_FORTRAN) { \
315:       v = PETSC_VIEWER_STDOUT_SELF; \
316:     } else if ((*(PetscFortranAddr *)vin) == PETSC_VIEWER_STDERR_WORLD_FORTRAN) { \
317:       v = PETSC_VIEWER_STDERR_WORLD; \
318:     } else if ((*(PetscFortranAddr *)vin) == PETSC_VIEWER_STDERR_SELF_FORTRAN) { \
319:       v = PETSC_VIEWER_STDERR_SELF; \
320:     } else if ((*(PetscFortranAddr *)vin) == PETSC_VIEWER_BINARY_WORLD_FORTRAN) { \
321:       v = PETSC_VIEWER_BINARY_WORLD; \
322:     } else if ((*(PetscFortranAddr *)vin) == PETSC_VIEWER_BINARY_SELF_FORTRAN) { \
323:       v = PETSC_VIEWER_BINARY_SELF; \
324:     } else if ((*(PetscFortranAddr *)vin) == PETSC_VIEWER_MATLAB_WORLD_FORTRAN) { \
325:       v = PETSC_VIEWER_BINARY_WORLD; \
326:     } else if ((*(PetscFortranAddr *)vin) == PETSC_VIEWER_MATLAB_SELF_FORTRAN) { \
327:       v = PETSC_VIEWER_BINARY_SELF; \
328:       PetscPatchDefaultViewers_Fortran_Socket(vin, v); \
329:     } else { \
330:       v = *vin; \
331:     } \
332:   } while (0)

334: /*
335:       Allocates enough space to store Fortran function pointers in PETSc object
336:    that are needed by the Fortran interface.
337: */
338: #define PetscObjectAllocateFortranPointers(obj, N) \
339:   do { \
340:     if (!((PetscObject)(obj))->fortran_func_pointers) { \
341:       *ierr = PetscCalloc((N) * sizeof(void (*)(void)), &((PetscObject)(obj))->fortran_func_pointers); \
342:       if (*ierr) return; \
343:       ((PetscObject)obj)->num_fortran_func_pointers = (N); \
344:     } \
345:   } while (0)

347: #define PetscCallFortranVoidFunction(...) \
348:   do { \
349:     PetscErrorCode ierr = PETSC_SUCCESS; \
350:     /* the function may or may not access ierr */ \
351:     __VA_ARGS__; \
352:     PetscCall(ierr); \
353:   } while (0)

355: /* Entire function body, _ctx is a "special" variable that can be passed along */
356: #define PetscObjectUseFortranCallback_Private(obj, cid, types, args, cbclass) \
357:   do { \
358:     void(*func) types, *_ctx; \
359:     PetscFunctionBegin; \
360:     PetscCall(PetscObjectGetFortranCallback((PetscObject)(obj), (cbclass), (cid), (PetscVoidFn **)&func, &_ctx)); \
361:     if (func) PetscCallFortranVoidFunction((*func)args); \
362:     PetscFunctionReturn(PETSC_SUCCESS); \
363:   } while (0)
364: #define PetscObjectUseFortranCallback(obj, cid, types, args)        PetscObjectUseFortranCallback_Private(obj, cid, types, args, PETSC_FORTRAN_CALLBACK_CLASS)
365: #define PetscObjectUseFortranCallbackSubType(obj, cid, types, args) PetscObjectUseFortranCallback_Private(obj, cid, types, args, PETSC_FORTRAN_CALLBACK_SUBTYPE)

367: /* Disable deprecation warnings while building Fortran wrappers */
368: #undef PETSC_DEPRECATED_OBJECT
369: #define PETSC_DEPRECATED_OBJECT(...)
370: #undef PETSC_DEPRECATED_FUNCTION
371: #define PETSC_DEPRECATED_FUNCTION(...)
372: #undef PETSC_DEPRECATED_ENUM
373: #define PETSC_DEPRECATED_ENUM(...)
374: #undef PETSC_DEPRECATED_TYPEDEF
375: #define PETSC_DEPRECATED_TYPEDEF(...)
376: #undef PETSC_DEPRECATED_MACRO
377: #define PETSC_DEPRECATED_MACRO(...)