How to avoid #error directive compiling HCL Notes program in Visual C++

45 views Asked by At

This is probably a stupid question but I can't figure it out. I'm trying to compile a program for HCL Notes (formerly Lotus/IBM Notes). I'm using Visual Studio 2022 C++, running under Windows 11, target is Release x64 for Windows. Getting the compile error:

#error directive: Must specify type of OS ("DOS", "OS2", etc) on C command line!

This is coming from the HCL header "global.h" which is trying to make me include some kind of switch to specify the operating system target. I've tried about everything I can think of on the "additional options" compiler command line, but I still get the error. Below is the relevant portion of the header file. Any insight on this would be appreciated.

#if defined(OS400)  /* This should appear before the OS2 test below, because that section tests for __IBMCPP__,
                            which our C++ compiler also generates */
    #define PLATFORM_NAME "OS/400"
    #ifndef UNIX
        #define UNIX
    #endif
    #ifndef W32
        #define W32             /* Compile for Windows 32 API - its emulated */
    #endif
    #ifndef W
        #define W               /* Compile for Windows 32 API - its emulated */
    #endif
    #if !defined(MIRAGE) && !defined(INTERNOTES)
        #define MIRAGE
    #endif
    #ifndef HANDLE_IS_32BITS
        #define HANDLE_IS_32BITS
    #endif
    #define BIG_ENDIAN_ORDER
    #define PREEMPTIVE
    #define SEMAPHORES
    #define SEMALLOC
    #define ODS_NEEDED TRUE
    #define COMPILER_INT_SIZE 4
    #define REQUIRED_ALIGNMENT 16
    #define NATURAL_ALIGNMENT 16
    #define PTRISNOT32BIT
    #define COMPILER_DWORD_ALIGNMENT 4
    #define COMPILER_NUMBER_ALIGNMENT 8
    #define VIM_USE_UNIX
    #define THREADS
    #ifndef NOGUI
        #define NOGUI
    #endif
    #if defined(__ILEC400__) || defined(__AIXxiCC__) || defined(__AIXxxlC400__)
        #define ILEC400
    #endif
#elif defined(NT) || (defined(W32) && !defined(UNIX))
    #ifndef W32
        #define W32
    #endif
    #ifndef W
        #define W
    #endif
    #ifndef NT
        #define NT
    #endif
#ifdef W64
    #define PLATFORM_NAME "Windows/64"
#else
    #define PLATFORM_NAME "Windows/32"
#endif
    #ifdef _MSC_VER
        #define MSC
    #endif
    #if defined(__IBMC__) || defined(__IBMCPP__)
        #define IBM_C
    #endif
    #define THREADS
    #define LITTLE_ENDIAN_ORDER
    #define PREEMPTIVE
    #define SEMAPHORES
    #define SEMALLOC
    #ifdef _X86_
        #define ODS_NEEDED FALSE
        /* Suppress "used #pragma pack to change alignment" */
        #pragma warning(disable:4103)
        /* Note: If you change the packing, you must also change inc\globpack.h */
        #pragma pack(1)
        #define REQUIRED_ALIGNMENT 1
        #define COMPILER_DWORD_ALIGNMENT 1
        #define COMPILER_NUMBER_ALIGNMENT 1
    #else
        #define ODS_NEEDED TRUE
        #define COMPILER_DWORD_ALIGNMENT 4
        #ifdef W64
            /* suppress "conversion from '' to '', possible loss of data warning */
            #pragma warning(disable: 4267)  
            /* suppress "conversion from '' to '', of greater size warning */
            #pragma warning(disable: 4306)  
            #define PTRISNOT32BIT
            #define PTRIS64BIT
            #define REQUIRED_ALIGNMENT 8
            #define NATURAL_ALIGNMENT 8
            #define COMPILER_NUMBER_ALIGNMENT 8
        #else
            #define REQUIRED_ALIGNMENT 4
            #define NATURAL_ALIGNMENT 4
            #define COMPILER_NUMBER_ALIGNMENT 4
        #endif
        #ifndef HANDLE_IS_32BITS
            #define HANDLE_IS_32BITS
        #endif
    #endif
    /* suppress "access-declarations are deprecated; member using-declarations provide a better alternative" warnings */
    #pragma warning(disable: 4516)
    #if (_MSC_VER >= 1600)
        /* suppress "name was marked as #pragma depracted - _CRT_SECURE_NO_WARNINGS should have covered this but some it did not */
        #pragma warning(disable: 4995)
        #pragma warning(disable: 4996)

        /* No checking on iterators in the product */
        #define _HAS_ITERATOR_DEBUGGING 0
    #endif

    #define COMPILER_INT_SIZE 4
    #define VIM_USE_MSWIN_NT
    #define OLEW32
    /*  Enable some OLE definitions which are only available for NT 4.0 and
        above.  The programmer must be careful not to use them on other
        Win32 platforms.
    */
#ifndef _WIN32_WINNT
    /* Keep this in sync with what is in w32prags.h and w64prags.h */
    #if (_MSC_VER >= 1600)
        #define _WIN32_WINNT    0x0501  /* Changed to 0501 so now at XP level */
    #else
        #define _WIN32_WINNT    0x0400
    #endif
#endif
#elif defined(MAC)
    #ifndef THREADID_IS_64BITS
    #define THREADID_IS_64BITS
    #endif

    #if defined(__powerc) || defined(powerc) || defined(__ppc__)
        #ifndef MAC_POWERPC
        #define MAC_POWERPC
        #endif
    #elif defined(__i386__) || defined(__x86_64__) || defined(__arm__) || defined(__arm64__)
        #ifndef MAC_X86
        #define MAC_X86
        #endif
    #else
        #error Undefined Mac processor
    #endif
    #if defined(IOS)
        #define PLATFORM_NAME "iOS"
    #else
        #if defined(ND64)
            #define PLATFORM_NAME "Macintosh/64"
        #else
            #define PLATFORM_NAME "Macintosh"
        #endif
    #endif
    #if defined(__BIG_ENDIAN__)
        #define BIG_ENDIAN_ORDER
    #else
        #define LITTLE_ENDIAN_ORDER
    #endif
    #ifndef HANDLE_IS_32BITS
        #define HANDLE_IS_32BITS
    #endif
    #if defined(ND64)
        #define PTRIS64BIT
        #define PTRISNOT32BIT
        #ifndef LONGIS64BIT
            #define LONGIS64BIT
        #endif
        /* We need this alignment for 64bit pointers */
        #define NATURAL_ALIGNMENT 8
        #define MEMALLOC_ALIGNMENT 8
    #endif
    #define THREADS
    #define PREEMPTIVE
    #define SEMAPHORES
    #define SEMALLOC
    #define ODS_NEEDED TRUE
    #define COMPILER_INT_SIZE 4
    /* For now, use 68k alignment for all Mac platforms */
    #if defined(ND64)
        #define REQUIRED_ALIGNMENT 8
        #define COMPILER_DWORD_ALIGNMENT 4
        #define COMPILER_NUMBER_ALIGNMENT 8
    #elif defined(MAC_X86)
        /* Try native alignment for Intel because ODS does not support 68k alignment with little endian */
        #define REQUIRED_ALIGNMENT 4        /* Intel supports odd-byte addressing, but it can't be used with system headers */
        #define COMPILER_DWORD_ALIGNMENT 4  /* Compiler will pad DWORDs to DWORD boundary if possible */
        #define COMPILER_NUMBER_ALIGNMENT 4
    #elif defined(MAC_POWERPC)
        #define REQUIRED_ALIGNMENT 1        /* PowerPC supports odd-byte addressing if truly required */
        #define COMPILER_DWORD_ALIGNMENT 2  /* Compiler will pad DWORDs to DWORD boundary if possible */
        #define COMPILER_NUMBER_ALIGNMENT 2
    #else
        #define REQUIRED_ALIGNMENT 1        /* 68020 or later CPUs only (not 68000) */
        #define COMPILER_DWORD_ALIGNMENT 2  /* Compiler will pad DWORDs to WORD boundary, because any further alignment is unnecessary */
        #define COMPILER_NUMBER_ALIGNMENT 2
    #endif
    #define VIM_USE_MAC
    /* Tdanalzye is a rudimentary parser, that is failing to correctly parse this long #if #elif statements.
     * It is re-processing the UNIX section after it has already processed the OS400 section and incorrectly
     * using a COMPILER_NUMBER_ALIGNMENT of 4.  So for now, add a redundant !OS400, until tdanalzye is fixed.
     */
#elif defined(UNIX)  && !defined(OS400)
    #ifndef W32
        #define W32             /* Compile for Windows 32 API - its emulated */
    #endif
    #ifndef W
        #define W               /* Compile for Windows 16 API - its emulated */
    #endif
    #if !defined(MIRAGE) && !defined(INTERNOTES)
        #define MIRAGE
    #endif

    #if (defined(ODT) || defined(SOLX86) || defined(UNIXWARE) || defined(OSF) || defined(LINUX)) && !defined(ZLINUX)
        #define LITTLE_ENDIAN_ORDER
    #else
        #define BIG_ENDIAN_ORDER
    #endif
    #define PREEMPTIVE
    #define SEMAPHORES
    #define SEMALLOC
    /* All 32-Bit UNIX type platforms except Solaris,HPUX, and AIX are 32 bit handle platforms */
    /* All 64-Bit UNIX type platforms are presently 32bit handles, but may be 64bit handles */
    /* This needs to be here so that it is also included in the SDK */
    #if defined(OSF) || defined(AIX64) || defined(SOLARIS64) || defined (LINUX64) || defined(__64BIT__) || defined(NDUNIX64)

        #ifdef ENABLE_64HANDLE
            #ifndef HANDLE_IS_64BITS
                #define HANDLE_IS_64BITS
            #endif
        #else
            #ifndef HANDLE_IS_32BITS
                #define HANDLE_IS_32BITS
            #endif
        #endif
        #define PTRIS64BIT
        #ifndef LONGIS64BIT
            #define LONGIS64BIT
        #endif
        #if defined(LINUX64) && !defined(THREADID_IS_64BITS)
            #define THREADID_IS_64BITS
        #endif
        #define PTRISNOT32BIT
        /* We need this alignment for 64bit pointers */
        #define NATURAL_ALIGNMENT 8
        #define MEMALLOC_ALIGNMENT 8
    #else
        #if !(defined(SOLARIS) || defined(HPUX) || defined(SOLX86) || defined(AIX))
            #ifndef HANDLE_IS_32BITS
            #define HANDLE_IS_32BITS
            #endif
        #endif
    #endif

    #if defined(AIX)
        #if defined(ND64)
            #define PLATFORM_NAME "AIX/64"
        #else
            #define PLATFORM_NAME "UNIX"
        #endif
        #define XLC_C
    #elif defined(SUN) || defined(SOLARIS)
        #if defined(ND64)
            #define PLATFORM_NAME "Solaris/64"
        #else
            #define PLATFORM_NAME "UNIX"
        #endif
        #define SUN_C
    #elif defined(HPUX)
        #define PLATFORM_NAME "UNIX"
        #define HP_C
    #elif defined(OS390)
        #define PLATFORM_NAME "UNIX"
        #define OS390_C
    #elif defined(UNIXWARE)
        #define PLATFORM_NAME "UNIX"
        #define UW_C
    #elif defined(__osf__)
        #define PLATFORM_NAME "UNIX"
        #if !defined(OSF)
            #define OSF
        #endif
        #define DEC_C
    #elif defined(ANDROID)
        #define PLATFORM_NAME "Android"
    #elif defined(EMSDK)
        #define PLATFORM_NAME "WebBrowser"
    #elif defined(LINUX)
        #if defined(ND64)
            #define PLATFORM_NAME "Linux/64"
        #else
            #define PLATFORM_NAME "UNIX"
        #endif
        #define GCC
    #else
        #define PLATFORM_NAME "UNIX"
    #endif

    #if (defined(SOLARIS) || defined(AIX) || defined (HPUX) || defined(OS390) || defined(LINUX)) && !defined(DISABLE_THREADS)
        #define THREADS
    #endif
    /*  ODS needed, even for ODT (on x86 machines), because X includes
        don't support having the compiler set for tight packing (-Zp1),
        that is, they assume padding.  With padding enabled, we must use
        ODS even when theoretically unncessary.  Perhaps the X headers
        can be kludged to explicitly pad so that this is unnecessary. */
    #if defined(ODT_LATER)
        #define COMPILER_INT_SIZE 4
        #define REQUIRED_ALIGNMENT 1
        #define COMPILER_DWORD_ALIGNMENT 2
        #define COMPILER_NUMBER_ALIGNMENT 2
    #else
        #define ODS_NEEDED TRUE
        #define COMPILER_INT_SIZE 4
        #if defined(ND64) 
            #define REQUIRED_ALIGNMENT 8
        #else
            #define REQUIRED_ALIGNMENT 4
        #endif
        #define COMPILER_DWORD_ALIGNMENT 4
        #if defined(SOLARIS) || defined(HPUX) || defined(OS390) || defined(ZLINUX) || (defined(LINUX86) && defined(LINUX64)) || defined(ANDROID64) || defined(EMSDK)
            #define COMPILER_NUMBER_ALIGNMENT 8
        #else
            #define COMPILER_NUMBER_ALIGNMENT 4
        #endif
    #endif
    #define VIM_USE_UNIX

#else
    #error Must specify type of OS ("DOS", "OS2", etc) on C command line!
#endif
0

There are 0 answers