-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MxConfig: Move HOST_OS_TYPE and HOST_WORD_SIZE
from constants in generated .i3, to function calls that delegate to C. This removes system specific backend output. Granted, these specific ones might be a losing battle, but they are near the important HOST which will be handled shortly. Make them return enums usually, but retain TEXT as an option. That is, before: CONST HOST_OS_TYPE: TEXT; CONST WORD_SIZE: TEXT; after: TYPE OS_TYPE = {POSIX, WIN32}; PROCEDURE HOST_OS_TYPE(): OS_TYPE; PROCEDURE HOST_OS_TYPE_TEXT(): TEXT; PROCEDURE HOST_WORD_SIZE(): INTEGER; (* 32 or 64 *) PROCEDURE HOST_WORD_SIZE_TEXT(): TEXT; And a bunch of Text.Equals goes away. This is "bad", if a new OS_TYPE is introduced, causing all consumers to recompile, whereas TEXT is a never changing always available type, but ok. Normally I'd name these OsType, WordSize, OsTypeAsText, WordSizeAsText, maybe with "Get" but probably not, but keeping fewer names and fewer names through time helps search. You can continue to search for os_type and word_size and find all relevant uses and definitions.
- Loading branch information
Showing
15 changed files
with
93 additions
and
24 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
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
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
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// This file is possibly subject to porting work, | ||
// i.e. if there are systems that are not Win32 or Posix, or | ||
// word sizes other than 32 or 64, etc. | ||
// | ||
// Code should avoid depending on this stuff though too. | ||
#include "m3core.h" | ||
|
||
M3_EXTERN_C_BEGIN | ||
|
||
// porting: Just Posix and Win32 or more? | ||
#ifdef _WIN32 | ||
EXTERN_CONST int MxConfig__os_type = 1; | ||
#else | ||
EXTERN_CONST int MxConfig__os_type = 0; | ||
#endif | ||
|
||
EXTERN_CONST int MxConfig__word_size = sizeof(INTEGER) * 8; | ||
|
||
M3_EXTERN_C_END |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
INTERFACE MxConfigC; | ||
|
||
IMPORT Ctypes; | ||
|
||
<*EXTERNAL "MxConfig__os_type"*> VAR os_type: Ctypes.int; (*MxConfig.OS_TYPE*) | ||
<*EXTERNAL "MxConfig__word_size"*> VAR word_size: Ctypes.int; | ||
|
||
END MxConfigC. |
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