-
Notifications
You must be signed in to change notification settings - Fork 7
build wwlib on linux #145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
build wwlib on linux #145
Changes from all commits
83fba9a
14a250b
11319a5
36cfa24
4ada1c6
0f8cf5c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -77,6 +77,7 @@ jobs: | |
| wwdebug | ||
| wwbitpack | ||
| wwtranslatedb | ||
| wwlib | ||
| shell: bash | ||
|
|
||
| steps: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -154,6 +154,63 @@ __forceinline unsigned int _byteswap_ulong(unsigned int value) | |
| #ifndef _alloca | ||
| #define _alloca(size) alloca(size) | ||
| #endif | ||
|
|
||
| #ifndef OutputDebugStringA | ||
| #define OutputDebugStringA(s) ((void)(s)) | ||
| #endif | ||
|
|
||
| // Windows BOOL type | ||
| #ifndef BOOL | ||
| typedef int BOOL; | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just replace use of BOOL with int and be done with it, as winapi is removed this shouldn't be needed.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. similar to the |
||
| #endif | ||
|
|
||
| // Windows path constant equivalents | ||
| #ifndef _MAX_DRIVE | ||
| #define _MAX_DRIVE 3 | ||
| #endif | ||
| #ifndef _MAX_DIR | ||
| #define _MAX_DIR 260 | ||
| #endif | ||
| #ifndef _MAX_PATH | ||
| #define _MAX_PATH 260 | ||
| #endif | ||
| #ifndef _MAX_FNAME | ||
| #define _MAX_FNAME 256 | ||
| #endif | ||
| #ifndef _MAX_EXT | ||
| #define _MAX_EXT 256 | ||
| #endif | ||
|
|
||
| // _splitpath: split a path into drive/dir/fname/ext components | ||
| static inline void _splitpath(const char *path, char *drive, char *dir, char *fname, char *ext) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd rather this function be moved to its own header along with the constants it uses and only included where needed.
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This can probably be replaced with |
||
| { | ||
| if (drive) drive[0] = '\0'; // no drive letters on Linux | ||
| const char *last_slash = strrchr(path, '/'); | ||
| const char *name_start = last_slash ? last_slash + 1 : path; | ||
| const char *last_dot = strrchr(name_start, '.'); | ||
| if (dir) { | ||
| if (last_slash) { | ||
| size_t n = (size_t)(last_slash - path) + 1; | ||
| std::memcpy(dir, path, n); | ||
| dir[n] = '\0'; | ||
| } else { | ||
| dir[0] = '\0'; | ||
| } | ||
| } | ||
| if (fname) { | ||
| size_t n = last_dot ? (size_t)(last_dot - name_start) : std::strlen(name_start); | ||
| std::memcpy(fname, name_start, n); | ||
| fname[n] = '\0'; | ||
| } | ||
| if (ext) { | ||
| if (last_dot) { | ||
| std::strcpy(ext, last_dot); | ||
| } else { | ||
| ext[0] = '\0'; | ||
| } | ||
| } | ||
| } | ||
|
|
||
| #endif // !_WIN32 | ||
|
|
||
| #endif | ||
This file was deleted.
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd be more inclined to remove these and replace with either WWDEBUG_SAY or pure printf. Generally I want to remove always.h and refactor into separate headers for the things its needed for.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reasonable to ask, but this is currently used many places in the code. I think that would make sense as a different PR?