Skip to content

Commit

Permalink
util: avoid defining variable multiple times
Browse files Browse the repository at this point in the history
Fixes danielgtaylor#119

> /usr/bin/ld: src/util.o:(.data+0x0): multiple definition of `VERSION';
>  /tmp/ccSwNFWH.o:(.bss+0x28): first defined here
> /usr/bin/ld: src/util.o:(.bss+0x0): multiple definition of `progname';
>  /tmp/ccSwNFWH.o:(.bss+0x20): first defined here
> collect2: error: ld returned 1 exit status
  • Loading branch information
sourcejedi committed Aug 1, 2022
1 parent 5b56afa commit 5b89654
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#define INPUT_BUFFER_SIZE 102400

const char *VERSION = "2.2.0";
const char *progname;

/* Print program version to stdout. */
void version(void) {
Expand Down
4 changes: 2 additions & 2 deletions src/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
#define MIN(a, b) ((a) < (b) ? (a) : (b))
#define MAX(a, b) ((a) > (b) ? (a) : (b))

const char *VERSION;
const char *progname;
extern const char *VERSION;
extern const char *progname;

// Subsampling method, which defines how much of the data from
// each color channel is included in the image per 2x2 block.
Expand Down

0 comments on commit 5b89654

Please sign in to comment.