Skip to content

Commit

Permalink
utils.h: remove compat macros
Browse files Browse the repository at this point in the history
It might be worth figuring out a more proper fix than this.

Fixes compiler error:

In file included from ntfswipe.c:63:
ntfswipe.c: In function ‘version’:
utils.h:113:58: error: expected expression before ‘)’ token
  113 |                 ntfs_utils_reformat(_b,MAX_FMT,fmt), args); } while (0)
      |                                                          ^
../include/ntfs-3g/logging.h:95:40: note: in expansion of macro ‘ntfs_log_redirect’
   95 | #define ntfs_log_info(FORMAT, ARGS...) ntfs_log_redirect(__FUNCTION__,__FILE__,__LINE__,NTFS_LOG_LEVEL_INFO,NULL,FORMAT,##ARGS)
      |                                        ^~~~~~~~~~~~~~~~~
  • Loading branch information
CodingKoopa committed Mar 8, 2024
1 parent d43ede9 commit f196023
Showing 1 changed file with 0 additions and 21 deletions.
21 changes: 0 additions & 21 deletions ntfsprogs/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,27 +101,6 @@ int mft_next_record(struct mft_search_ctx *ctx);
#define MAX_PATH 1024
#endif

#ifdef HAVE_WINDOWS_H
/*
* Macroes to hide the needs to translate formats on older Windows
*/
#define MAX_FMT 1536
char *ntfs_utils_reformat(char *out, int sz, const char *fmt);
char *ntfs_utils_unix_path(const char *in);
#define ntfs_log_redirect(fn,fi,li,le,d,fmt, args...) \
do { char _b[MAX_FMT]; ntfs_log_redirect(fn,fi,li,le,d, \
ntfs_utils_reformat(_b,MAX_FMT,fmt), args); } while (0)
#define printf(fmt, args...) \
do { char _b[MAX_FMT]; \
printf(ntfs_utils_reformat(_b,MAX_FMT,fmt), args); } while (0)
#define fprintf(str, fmt, args...) \
do { char _b[MAX_FMT]; \
fprintf(str, ntfs_utils_reformat(_b,MAX_FMT,fmt), args); } while (0)
#define vfprintf(file, fmt, args) \
do { char _b[MAX_FMT]; vfprintf(file, \
ntfs_utils_reformat(_b,MAX_FMT,fmt), args); } while (0)
#endif

/**
* linux-ntfs's ntfs_mbstoucs has different semantics, so we emulate it with
* ntfs-3g's.
Expand Down

0 comments on commit f196023

Please sign in to comment.