Skip to content

Commit 6364228

Browse files
committed
Fixed definition for max on linux
1 parent 7f5190b commit 6364228

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

main.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77

88
#define ARG(i, s) (strcmp(argv[i], s) == 0)
99

10+
#ifndef WIN32
11+
#define max(x, y) ((x) > (y) ? (x) : (y))
12+
#else
13+
#define max __max
14+
#endif
15+
1016
static inline void PRINT_REPORT_HEADER()
1117
{
1218
printf("--------------------------+------------+------------+------------+------------\n");
@@ -35,7 +41,7 @@ static inline void PRINT_FILE_REPORT_HEADER()
3541

3642
static inline void PRINT_FILE_REPORT(char* file, loc_info *li)
3743
{
38-
int len = __max(strlen(file), 50);
44+
int len = max(strlen(file), 50);
3945
file = file + len - 50;
4046
file[0] = '~';
4147
printf("%-50s | %-25s | %10d | %10d | %10d\n", file, languages[li->language_id].name, li->total_lines, li->code_lines, li->com_lines);

src/ccloc.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,10 +45,6 @@
4545

4646
#define MAX_FILE_DISPLAY_LEN 50
4747

48-
#ifndef WIN32
49-
#define max(x, y) ((x) > (y) ? (x) : (y))
50-
#endif
51-
5248
typedef struct _loc_list_node
5349
{
5450
char str[MAX_FILE_LEN];

0 commit comments

Comments
 (0)