I would like to compile a c program developed for linux using cc under os x. It includes the sys / io.h header. When compiling, I get an error that this file cannot be found? Is there a header file under os x in ss / io.h?
Any help would be really appreciated!
Thank!
Turn on <sys/uio.h>.
<sys/uio.h>
or why not both?
#ifdef __APPLE__ #include <sys/uio.h> #else #include <sys/io.h> #endif
In case of Apple OS (OSX / iOS), the code will know compilation with <sys/uio.h>
What bibor wrote is perfect. Although my file looks something like this and works well.
#ifdef __linux #include <io.h> #elseif __apple #include<uio.h>
$ ls /usr/include/sys/io.h ls: /usr/include/sys/io.h: No such file or directory
. , .
Linux . , .
, /usr/include/sys , , .
, .
https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6/+/master/sysroot/usr/include/sys/io.h
: .h
https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/host/x86_64-linux-glibc2.7-4.6/+/master/sysroot/usr/include/features.h
, , io.h . - . , ...
static inline void outb(unsigned short port, unsigned char value) { __asm__ __volatile__ ("outb %1, %0" : : "dN" (port), "a" (value)); } static inline unsigned char inb(unsigned short port) { unsigned char value; __asm__ __volatile__ ("inb %1, %0" : "=a"(value) : "Nd"(port)); return value; } void update_cursor(int row, int col) { unsigned short position=(row*80) + col; // cursor LOW port to vga INDEX register outb(0x3D4, 0x0F); outb(0x3D5, (unsigned char)(position&0xFF)); // cursor HIGH port to vga INDEX register outb(0x3D4, 0x0E); outb(0x3D5, (unsigned char )((position>>8)&0xFF)); }
Source: https://habr.com/ru/post/1743907/More articles:if I wanted to perform aperture scan, do I need some additional api, or can I just use what is easily accessible? - android.NET: XDocument отсутствует XDeclaration? - c#Display all images from an external root folder using PHP - phpCan I play any buffer only once at a specific time? - iphoneDownload multiple preview files - uploadhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1743908/when-you-need-pass-by-reference-in-java-to-assign-values-to-multiple-parameters-how-do-you-do-it&usg=ALkJrhi-Wa4V05z4JtLthP31HDdMytKVvwКак избежать сбоя вашего веб-приложения во время замены файла? - phpУбейте 10-минутный процесс зомби в Linux bash script - linuxFixed mouse cursor with jQuery draggable - javascriptProblem with WHERE columnName = Data in MySQL query in C # - c #All Articles