avoid double declarations (with gcc)

```
                 from libcurl_unity.c:41:
memdebug.h:52:14: error: redundant redeclaration of 'curl_dbg_logfile' [-Werror=redundant-decls]
   52 | extern FILE *curl_dbg_logfile;
      |              ^~~~~~~~~~~~~~~~
In file included from altsvc.c:49,
                 from libcurl_unity.c:2:
memdebug.h:52:14: note: previous declaration of 'curl_dbg_logfile' with type 'FILE *'
   52 | extern FILE *curl_dbg_logfile;
      |              ^~~~~~~~~~~~~~~~
[...]
```
https://github.com/curl/curl/actions/runs/13462106475/job/37619673742?pr=16428#step:36:66
This commit is contained in:
Viktor Szakats 2025-02-21 18:42:15 +01:00
parent cda0b11328
commit 08a8e4ffca
No known key found for this signature in database
GPG Key ID: B5ABD165E2AEF201

View File

@ -33,6 +33,11 @@
#include <curl/curl.h>
#include "functypes.h"
/* Avoid double definitions/declarations, in case we include this header
again after a 'memdebug_reset.h'. */
#ifndef HEADER_CURL_MEMDEBUG_H_DECL
#define HEADER_CURL_MEMDEBUG_H_DECL
#if defined(__GNUC__) && __GNUC__ >= 3
# define ALLOC_FUNC __attribute__((__malloc__))
# define ALLOC_SIZE(s) __attribute__((__alloc_size__(s)))
@ -108,6 +113,7 @@ CURL_EXTERN ALLOC_FUNC FILE *curl_dbg_fdopen(int filedes, const char *mode,
int line, const char *source);
CURL_EXTERN int curl_dbg_fclose(FILE *file, int line, const char *source);
#endif /* HEADER_CURL_MEMDEBUG_H_DECL */
#ifndef MEMDEBUG_NODEFINES