History

macos: add darwin OS detection.

Christian Jullien committed 6 years ago

Commit c6935661 parent a3d1e9c1 file · +7 −4Browse files

Unified · Split

conftest.c+7−4
@@ -24,8 +24,10 @@ · 23 unmodified lines
2424 # define TRIPLET_OS "linux"
2525 #elif defined (__FreeBSD__) || defined (__FreeBSD_kernel__)
2626 # define TRIPLET_OS "kfreebsd"
27−#elif defined _WIN32
27+#elif defined(_WIN32)
2828 # define TRIPLET_OS "win32"
29+#elif defined(__APPLE__)
30+# define TRIPLET_OS "darwin"
2931 #elif !defined (__GNU__)
3032 # define TRIPLET_OS "unknown"
3133 #endif
@@ -65,21 +67,22 @@ int main(int argc, char *argv[]) · 33 unmodified lines
6567 puts(*(unsigned char*)&foo == 0x67 ? "no" : "yes");
6668 break;
6769 }
68−#ifdef __clang__
70+#if defined(__clang__)
6971 case 'm':
7072 printf("%d\n", __clang_minor__);
7173 break;
7274 case 'v':
7375 printf("%d\n", __clang_major__);
7476 break;
75−#elif defined __TINYC__
77+#elif defined(__TINYC__)
7678 case 'v':
7779 puts("0");
7880 break;
7981 case 'm':
8082 printf("%d\n", __TINYC__);
8183 break;
82−#elif defined( __GNUC__) && defined(__GNUC_MINOR__)
84+#elif defined(__GNUC__) && defined(__GNUC_MINOR__)
85+ /* GNU comes last as other compilers may add 'GNU' compatibility */
8386 case 'm':
8487 printf("%d\n", __GNUC_MINOR__);
8588 break;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t