Skip to content
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

_WINDOWS macro is not defined #231

Open
felixmaker opened this issue Jan 15, 2025 · 0 comments
Open

_WINDOWS macro is not defined #231

felixmaker opened this issue Jan 15, 2025 · 0 comments

Comments

@felixmaker
Copy link

Macro _WINDOWS should be defined with MSVC

/*
 * NAppGUI Cross-platform C SDK
 * 2015-2025 Francisco Garcia Collado
 * MIT Licence
 * https://nappgui.com/en/legal/license.html
 *
 * File: arch.hxx
 *
 */

/* Architectures */

#ifndef __BASEARCH_HXX__
#define __BASEARCH_HXX__

/* clang-format off */

#if defined (_WINDOWS)
    #if defined (_MSC_VER) && _MSC_VER <= 1500
        #define __STDC_LIMIT_MACROS
    #endif

    #define __WINDOWS__
    #define __DESKTOP__
    #if defined (_M_AMD64)
        #define __x64__
    #elif defined (_M_IX86)
        #define __x86__
    #else
        #error Unknown processor
    #endif

#elif defined (__APPLE__)
    #include <TargetConditionals.h>

    #if TARGET_OS_MAC == 1
        #define __UNIX__
        #if TARGET_OS_IPHONE == 1
            #define __IOS__
            #define __EMBEDDED__
            #define __ARM__
        #else
            #define __MACOS__
            #define __DESKTOP__

            #if defined (__i386__)
                #define __x86__
            #elif defined (__x86_64__)
                #define __x64__
            #elif defined (__arm64__)
                #define __ARM64__
            #else
                #error Unknown processor
            #endif

        #endif
    #else
        #error APPLE Machine not supported
    #endif

#elif defined(__linux__)
    #define __UNIX__
    #define __LINUX__
    #define __DESKTOP__

    #if defined(__GTK3_TOOLKIT__)
        #define __GTK3__
    #endif

    #if defined (__i386__)
        #define __x86__
    #elif defined (__x86_64__)
        #define __x64__
    #elif defined (__arm__)
        #define __ARM__
    #elif defined (__aarch64__)
        #define __ARM64__
    #else
        #error Unknown processor
    #endif

#else
    #error Unknown configuration
#endif

#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant