Progress introduced a 64-bit Windows product in OpenEdge 10.2A. This was a Server-only product that included a 64-bit character (TTY) client. A 32-bit GUI client was also included; this was intended for running GUI Administration tools such as the Data Dictionary only.
Progress introduced a full 64-bit Windows GUI client in OpenEdge 11.3. The PROCESS-ARCHITECTURE function was also introduced in OE 11.3; this function returns an integer value "32" or "64" depending on whether the code is running in a 32-bit or 64-bit version of OpenEdge.
The following ABL code uses the PROCESS-ARCHITECTURE, PROVERSION, and WINDOW-SYSTEM preprocessor variables to compile the correct code for the OpenEdge version and platform on which the code is being compiled. The code will correctly detect:
- 32-bit or 64-bit versions of OpenEdge in release 11.3 and later
- OpenEdge releases which only have 32-bit Windows clients (10.1C and earlier for character clients, 11.2 and earlier for GUI clients)
- OpenEdge releases in which a 32-bit or a 64-bit client may be running, but it is impossible to determine which because the PROCESS-ARCHITECTURE function is not available (10.2A through 11.2 character clients). In this case the code defaults to the 32-bit assumption and notifies the user
As an example of the type of information that might be set conditionally based on a 32-bit or 64-bit process, this code defines the following preprocessor variables:
- POINTERTYPE ("LONG" for 32-bit processes or "INT64" for 64-bit processes)
- POINTERSIZE (4 for 32-bit processes or 8 for 64-bit processes)
While Windows system directory and registry hive locations are not relevant to UNIX systems, pointer size remains an issue. This example is restricted to Windows clients for simplicity, but it can be modified to account for the versions in which 64-bit character clients became available on various UNIX platforms. The check for WINDOW-SYSTEM would not be needed for
UNIX because only character (TTY) clients are available on those platforms. See the References to Other Documentation below for the versions in which 64-bit clients are available on various Unix platforms.
/* WindowsGeneral_3264.i */
&IF PROVERSION <= '8' &THEN /* OE 10+ */
&IF PROVERSION >= '11.3' &THEN /* PROCESS-ARCHITECTURE function is available */
&IF PROCESS-ARCHITECTURE = 32 &THEN /* 32-bit pointers */
&GLOBAL-DEFINE POINTERTYPE 'LONG'
&GLOBAL-DEFINE POINTERBYTES 4
MESSAGE '11.3+ 32-bit' VIEW-AS ALERT-BOX.
&ELSEIF PROCESS-ARCHITECTURE = 64 &THEN /* 64-bit pointers */
&GLOBAL-DEFINE POINTERTYPE 'INT64'
&GLOBAL-DEFINE POINTERBYTES 8
MESSAGE '11.3+ 64-bit' VIEW-AS ALERT-BOX.
&ENDIF /* PROCESS-ARCHITECTURE */
&ELSE /* Can't check architecture pre-11.3 so default to 32-bit */
&GLOBAL-DEFINE POINTERTYPE 'LONG'
&GLOBAL-DEFINE POINTERBYTES 4
MESSAGE 'pre-11.3 -- defaulting to 32-bit' VIEW-AS ALERT-BOX.
/* TTY 10.2A - 11.2 client might be 64-bit, so alert user if not in batch mode.
Batch mode clients cannot respond to alert, but messages will appear in
standard output to aid in debugging if code is run on wrong platform. */
&IF PROVERSION >= '10.2A' &THEN
&IF "{&WINDOW-SYSTEM}" = "TTY" &THEN
MESSAGE
'WARNING: Defaulting to 32-bit printer enumeration' SKIP
'This procedure will not operate correctly in an OpenEdge'
PROVERSION '64-bit client' SKIP 'Proceed?'
VIEW-AS ALERT-BOX WARNING BUTTONS YES-NO UPDATE lProceed AS LOGICAL.
IF NOT lProceed THEN QUIT.
MESSAGE 'Proceeding...' VIEW-AS ALERT-BOX.
&ENDIF /* WINDOW-SYSTEM */
&ENDIF /* PROVERSION > 10.2A */
&ENDIF /* PROVERSION > 11.3 */
&ELSE /* pre-OE10 always 32-bit on Windows */
MESSAGE 'pre-OE10 -- defaulting to 32-bit' VIEW-AS ALERT-BOX.
&GLOBAL-DEFINE POINTERTYPE 'LONG'
&GLOBAL-DEFINE POINTERBYTES 4
&ENDIF /* PROVERSION < 8 */
Note: This function has a corresponding preprocessor. {&PROCESS-ARCHITECTURE} expands to either "32" or "64".