]> git.draconx.ca Git - cdecl99.git/blobdiff - src/cdecl-internal.h
libcdecl: Remove error code argument from cdecl__err.
[cdecl99.git] / src / cdecl-internal.h
index a1e8a9665b21ebe9593dca36eb25142e35648abe..b586dd45e5b00b7c08d2da83b211cce8f3556293 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * Internal declarations for libcdecl.
- * Copyright © 2021, 2023 Nick Bowler
+ * Copyright © 2021, 2023-2024 Nick Bowler
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -70,7 +70,7 @@ static inline void cdecl__init_i18n(void)
 }
 #endif
 
-void cdecl__err(unsigned code, const char *fmt, const char *arg);
+void cdecl__err(const char *fmt, const char *arg);
 void cdecl__errmsg(unsigned msg);
 
 struct cdecl_declspec *cdecl__normalize_specs(struct cdecl_declspec *specs);
@@ -117,4 +117,21 @@ struct parse_item {
 
 struct parse_item *cdecl__alloc_item(size_t s_sz);
 
+/*
+ * GCC enables -finline-small-functions in most optimization modes; this works
+ * on a highlevel estimate of how big a function actually is and occasionally
+ * this produces really bad results.
+ *
+ * While old versions of GCC do not support this attribute the result seems
+ * to be merely a warning so hopefully we can get away with this check and
+ * save a configure test.
+ */
+#ifndef CDECL__NOINLINE
+#  if __GNUC__
+#    define CDECL__NOINLINE __attribute__((__noinline__))
+#  else
+#    define CDECL__NOINLINE /**/
+#  endif
+#endif
+
 #endif