-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix build with link-time optimization
When building with link-time optimization enabled, the compiler errors out due to some arrays being declared with different sizes in different compilation units. All of the problematic declarations are of character arrays of size MAXPATHLEN in xv.h, which is included by all of xv's source files. However, the value of the token MAXPATHLEN varies depending on whether or not the token NEEDSDIR is defined at the time of xv.h's inclusion. If it is defined, MAXPATHLEN will be defined via system headers, typically to a value of 4096. If it is not defined, a default value of 256 is used. The NEEDSDIR mechanism was probably created to speed up compilation by not including files unnecessarily on the very old and slow systems that xv was originally written for, and is almost certainly unnecessary now. Hence, the fix for this issue is to get rid of NEEDSDIR altogether and just include the necessary files unconditionally. Fixes #25.
- Loading branch information
Showing
12 changed files
with
19 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,7 +6,6 @@ | |
|
||
#define MAIN | ||
#define NEEDSTIME | ||
#define NEEDSDIR /* for value of MAXPATHLEN */ | ||
|
||
#include "xv.h" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,6 @@ | |
|
||
#include "copyright.h" | ||
|
||
#define NEEDSDIR | ||
#include "xv.h" | ||
#include <unistd.h> /* access() */ | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,7 +47,6 @@ | |
*/ | ||
|
||
|
||
#define NEEDSDIR /* for stat() */ | ||
#include "copyright.h" | ||
#include "xv.h" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,7 +60,6 @@ | |
* 同様に書き込み時にも問題が生じるかもしれない。 | ||
*/ | ||
|
||
#define NEEDSDIR /* for stat() */ | ||
#include "xv.h" | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -61,7 +61,6 @@ | |
*/ | ||
|
||
#define PIC2_IGNORE_UNUSED_FUNCTIONS | ||
#define NEEDSDIR | ||
|
||
#include "xv.h" | ||
#include <setjmp.h> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,6 @@ | |
|
||
#include "copyright.h" | ||
|
||
#define NEEDSDIR | ||
#include "xv.h" | ||
|
||
#define PSWIDE 431 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,6 @@ | |
* (virtual) directory. | ||
*/ | ||
|
||
#define NEEDSDIR | ||
|
||
#include "xv.h" | ||
|
||
#ifdef AUTO_EXPAND | ||
|