- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I'd like to use an assert macro implemented via the fpp preprocessor. In order to do so I'd like to know if there are preprocessor definitions for the current line and the current function available (like in C/C++).
Currently I use something like this (which is working properly):
#ifndef UT_MACRO_H
#define UT_MACRO_H
#define _DEBUG
#ifdef _DEBUG
#define ASSERT(x) call lgAbortIf(.not. (x), "DEBUG ASSERTION: "//#x)
#else
#define ASSERT(X)
#endif
#endif
Currently I use something like this (which is working properly):
#ifndef UT_MACRO_H
#define UT_MACRO_H
#define _DEBUG
#ifdef _DEBUG
#define ASSERT(x) call lgAbortIf(.not. (x), "DEBUG ASSERTION: "//#x)
#else
#define ASSERT(X)
#endif
#endif
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
No, there aren't.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Okay, usually I don't disagree with Steve, but ... if you are using Intel Fortran, the answer is "Yes", the preprocessor supports __FILE__, __DATE__, __TIME__ and __LINE__.
- Lorri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sure, you disagree with me all the time, esxpecially when I'm wrong. I had forgotten that the Intel version of fpp did support these.
Steve
Steve

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page