COO to CSR format #include #include #include #ifdef __linux__ #include &vec, const int mem_alignment) { size_t num_bytes = vec.size() * sizeof(T); #ifdef __linux...convert creating coo mtx"); } size_t num_bytes_x = num_cols * sizeof(float); #ifdef __linux...delete matrices mkl_sparse_destroy(coo_mtx); mkl_sparse_destroy(csr_mtx); #ifdef __linux
string.h> #include #include #include #include #if defined(__linux...method_onEvent; static jint android_os_fileobserver_init(JNIEnv* env, jobject object) { #if defined(__linux...static void android_os_fileobserver_observe(JNIEnv* env, jobject object, jint fd) { #if defined(__linux...JNIEnv* env, jobject object, jint fd, jstring pathString, jint mask) { int res = -1; #if defined(__linux...android_os_fileobserver_stopWatching(JNIEnv* env, jobject object, jint fd, jint wfd) { #if defined(__linux
* file , UINT line , const CHAR * func , const CHAR * expr ) { CHAR szTemp[1024] = {0}; #ifdef __LINUX...line, func, expr ) ; #endif __show__(szTemp) ; } VOID __show__( const CHAR* szTemp ) { #ifdef __LINUX...() ; INT iRet = ::MessageBoxA( NULL, szTemp, "异常", MB_OK ) ; lock.Unlock() ; } #elif defined(__LINUX
GetMacAddr(); } #endif // __DDR_GET_MAC_ADDR_FUNC_H_INCLUDED__ 源码: windows下要定义宏:_WIN32和_WIN64 linux下要定义宏:__linux...endif #include #include #pragma comment(lib, "iphlpapi.lib") #elif defined(__linux
//宏定义空操作 #endif 练习: #if _WIN32 printf("windows系统 \n"); #elif __linux__
// Other kinds of Mac OS #else # error "Unknown Apple platform" #endif #elif __linux
摄像头驱动名称 * @return {*} */ void cameraGstPushStreamStop(std::string devicename); #ifdef __linux...getCameraList() { std::map cameras; #ifdef _WIN32 #elif __linux...getCameraResolutions(std::string dev) { std::list resolutions = {}; #ifdef _WIN32 #elif __linux...CameraEvent::getInputVPIDs() { std::map inputInfos; #ifdef _WIN32 #elif __linux...udevadmMonitor(struct udev udev, struct udev_monitor &kernelMonitor, fd_set &readFds) 热拔插检测事件 #ifdef __linux
0x0600) // Windows Vista以上 UNIX #ifdef __unix //or #ifdef __unix__ Linux #ifdef __linux //or #ifdef __linux
UV_FS_LSTAT)) { req->ptr = &req->statbuf; } } static ssize_t uv__fs_read(uv_fs_t* req) { #if defined(__linux...result = preadv(req->file, (struct iovec*) req->bufs, req->nbufs, req->off); #else # if defined(__linux...{ result = uv__fs_preadv(req->file, req->bufs, req->nbufs, req->off); } # if defined(__linux...buf; ssize_t len; int fd; int r; buf = ""; len = 1; fd = loop->async_wfd; #if defined(__linux
= -1) return 0; #ifdef __linux__ err = eventfd(0, EFD_CLOEXEC | EFD_NONBLOCK); if (err < 0)...buf; ssize_t len; int fd; int r; buf = ""; len = 1; fd = loop->async_wfd; #if defined(__linux
导出的cpp文件中摘录如下代码: #ifndef __APPLE__ # include "HalconCpp.h" # include "HDevThread.h" # if defined(__linux
. // #ifdef __linux__ std::string ident = “spdlog-example”; auto syslog_logger = spd::syslog_logger(“
这就需要调用方完全知道自己需要什么功能的接口,然后将自己需要的接口声明在一个公有的头文件里,在定义时 CppNet 通过 __linux__ 宏在编译期选择不同的实现代码。...__linux__ 宏在 Linux 平台编译的时候会自动定义。如果不是上层必须的接口,则不同平台自己定义文件实现内部消化,不会让上层感知。
hello 就不会被 g++ 编译器改写,因此就可以被 C 代码来调用; 示例2:用来区分不同的平台 #if defined(linux) || defined(__linux) || defined(__linux...defined(_WIN32) Sleep(1000 * 1000); // 调用 Windows 平台下的库函数(第一个字母是大写) #endif 那么,这些 linux, __linux, __linux...示例3:在编写 Windows 平台下的动态库时,声明导出和导入函数 #if defined(linux) || defined(__linux) || defined(__linux__) #
#if defined(SO_REUSEPORT) && defined(__linux__) on = 1; if ((flags & UV_TCP_REUSEPORT) && setsockopt...首先导出一个新的常量 #if defined(SO_REUSEPORT) && defined(__linux__) NODE_DEFINE_CONSTANT(constants, UV_TCP_REUSEPORT
| defined(ultrix) # define Q_OS_ULTRIX #elif defined(sinix) # define Q_OS_RELIANT #elif defined(__linux
例如; if __Linux__ //Linux专有函数代码 #elif _Win32 //windows专有函数代码 #else //其他平台专有函数代码 #endif 2 头文件防卫式声明
BSD */ #include //I/O控制操作相关的函数声明,如ioctl() #ifndef __linux__ #include #endif...{ int sock; struct arpreq ar; struct sockaddr_in *sin; memset((char *)&ar, 0, sizeof(ar)); #ifdef __linux...retval) fprintf(stderr, "%s", libnet_geterror(l)); libnet_clear_packet(l); return retval; } #ifdef __linux...struct ether_addr *mac) { int i = 0; do { if (arp_cache_lookup(ip, mac, intf) == 0) return (1); #ifdef __linux
领取专属 10元无门槛券
手把手带您无忧上云