]> git.ozlabs.org Git - ccan/blobdiff - ccan/cpuid/_info
cpuid: fix example compilation
[ccan] / ccan / cpuid / _info
index b6e0caf7b1dd402b7bde0aea44fbf468b8d1cc30..79a98c0a236dfc2ad98010a01afb4bcb9726f74c 100644 (file)
@@ -8,12 +8,13 @@
  *
  * Example:
  * #include <ccan/cpuid/cpuid.h>
+ * #include <stdio.h>
  *
- * int main()
+ * int main(void)
  * {
- *     int highest;
- *     cpuid(CPU_HIGHEST_EXTENDED_FUNCTION_SUPPORTED, &highest);
- *     printf ("Highest extended function supported: %d\n", highest);
+ *     uint32_t highest;
+ *     cpuid(CPUID_HIGHEST_EXTENDED_FUNCTION_SUPPORTED, &highest);
+ *     printf("Highest extended function supported: %d\n", highest);
  *
  *      return 0;
  * }
@@ -29,7 +30,12 @@ int main(int argc, char *argv[])
                return 1;
 
        if (strcmp(argv[1], "depends") == 0) {
+#if defined(__i386__) || defined(__i386) || defined(__x86_64) \
+               || defined(_M_AMD64) || defined(__M_X64)
                /* Nothing.  */
+#else
+               printf("ccan/build_assert\n");
+#endif
                return 0;
        }