SQUIDCEXTERN int gethostname(char *, int);
#endif
-/*
- * SunStudio CC does not define C++ portability API __FUNCTION__
- */
-#if defined(__SUNPRO_CC) && !defined(__FUNCTION__)
-#define __FUNCTION__ ""
-#endif
-
/* Bug 2500: Solaris 10/11 require s6_addr* defines. */
//#define s6_addr8 _S6_un._S6_u8
//#define s6_addr16 _S6_un._S6_u16
#include <iosfwd>
/// source code location of the caller
-#define Here() SourceLocation(__FUNCTION__, __FILE__, __LINE__)
+#define Here() SourceLocation(__func__, __FILE__, __LINE__)
/// semi-uniquely identifies a source code location; stable across Squid runs
typedef uint32_t SourceLocationId;
entry = e;
entry->lock("clientReplyContext::processExpired#alreadyRevalidating");
} else {
- e->abandon(__FUNCTION__);
+ e->abandon(__func__);
// assume mayInitiateCollapsing() would fail too
collapsingAllowed = false;
}
const auto err = clientBuildError(ERR_ACCESS_DENIED, Http::scForbidden, nullptr,
http->getConn(), http->request, http->al);
startError(err);
- entry->abandon(__FUNCTION__);
+ entry->abandon(__func__);
return;
}
firstFound = true;
#ifdef __PRETTY_FUNCTION__
#define MYNAME __PRETTY_FUNCTION__ << " "
#else
-#define MYNAME __FUNCTION__ << " "
+#define MYNAME __func__ << " "
#endif
/* some uint8_t do not like streaming control-chars (values 0-31, 127+) */
if (!InitializeCriticalSectionAndSpinCount(dbg_mutex, 4000)) {
if (const auto logFile = TheLog.file()) {
- fprintf(logFile, "FATAL: %s: can't initialize critical section\n", __FUNCTION__);
+ fprintf(logFile, "FATAL: %s: can't initialize critical section\n", __func__);
fflush(logFile);
}
- fprintf(stderr, "FATAL: %s: can't initialize critical section\n", __FUNCTION__);
+ fprintf(stderr, "FATAL: %s: can't initialize critical section\n", __func__);
abort();
} else
InitializeCriticalSection(dbg_mutex);
const auto hit = e && confirmAndPrepHit(*e);
if (e)
- e->abandon(__FUNCTION__);
+ e->abandon(__func__);
return hit;
}
if (const auto e = storeGetPublic(url_, Http::METHOD_GET)) {
// do not overwrite an already stored icon
- e->abandon(__FUNCTION__);
+ e->abandon(__func__);
return;
}
int removed = 0;
while (const auto entry = walker->Next(walker)) {
// Abandoned memory cache entries are purged during memory shortage.
- entry->abandon(__FUNCTION__); // may delete entry
+ entry->abandon(__func__); // may delete entry
++removed;
if (memoryCacheHasSpaceFor(pagesRequired))
#include <iostream>
// Internal Special: the STUB framework requires this function
-#define stub_fatal(m) { std::cerr<<"FATAL: "<<(m)<<" for use of "<<__FUNCTION__<<"\n"; exit(EXIT_FAILURE); }
+#define stub_fatal(m) { std::cerr<<"FATAL: "<<(m)<<" for use of "<<__func__<<"\n"; exit(EXIT_FAILURE); }
/// macro to stub a void function.
#define STUB { stub_fatal(STUB_API " required"); }
/// macro to stub a void function without a fatal message
/// Intended for registration pattern APIs where the function result does not matter to the test
-#define STUB_NOP { std::cerr<<"SKIP: "<<STUB_API<<" "<<__FUNCTION__<<" (not implemented).\n"; }
+#define STUB_NOP { std::cerr<<"SKIP: "<<STUB_API<<" "<<__func__<<" (not implemented).\n"; }
/// macro to stub a function with return value.
/// Aborts unit tests requiring its definition with a message about the missing linkage
/// macro to stub a void function without a fatal message and with a return value
/// Intended for registration pattern APIs where the function result does not matter to the test
-#define STUB_RETVAL_NOP(x) { std::cerr<<"SKIP: "<<STUB_API<<" "<<__FUNCTION__<<" (not implemented).\n"; return x; }
+#define STUB_RETVAL_NOP(x) { std::cerr<<"SKIP: "<<STUB_API<<" "<<__func__<<" (not implemented).\n"; return x; }
/** macro to stub a function which returns a reference to dynamic
* Aborts unit tests requiring its definition with a message about the missing linkage
sc = storeClientListAdd(urlres_e, this);
FwdState::Start(Comm::ConnectionPointer(), urlres_e, urlres_r.getRaw(), ale);
if (urlEntry) {
- urlEntry->abandon(__FUNCTION__);
+ urlEntry->abandon(__func__);
urlEntry = nullptr;
}
} else {
urlres_e = urlEntry;
- urlres_e->lock("UrnState::start");
+ urlres_e->lock(__func__);
sc = storeClientListAdd(urlres_e, this);
}