I have two projects. Each project contains a header file and a c file. Project 1 is a library. Project 2 is the application with main. I would like to place a #ifdef around all the code...
then you can do it with the help of the functions described below. Keep in mind that the functions described below will only run on Text Mode. Using the colors, you can make your program more attractive in C /C++.
Even though you are defining Debugmode as 0, the preprocessor is still defining it as something, so the code in the ifdef statement will compile. You would need to remove the definition statement completely or comment it out for the compiler to skip the doSomething() funct...
gcc -c idnint.c ... Create library: ar -cvq libvax.a inint.o idnint.o ... C++: When mixing Fortran with C++, name mangling must be prevented. #ifdef __cplusplus extern"C" { #endif . . place declarations here . . #ifdef __cplusplus } #endif For more on C++ name ma...
// C++11 should be used directly in JSONCPP. #define JSONCPP_OVERRIDE override #ifdef __clang__ #if __has_extension(attribute_deprecated_with_message) #define JSONCPP_DEPRECATED(message) __attribute__((deprecated(message))) #endif #elif defined(__GNUC__) // not clang (gcc comes later ...
#ifdef __clang__ #pragma clang diagnostic ignored "-Wc++98-compat" #pragma clang diagnostic ignored "-Wc++98-compat-pedantic" #pragma clang diagnostic ignored "-Wgnu-anonymous-struct" #pragma clang diagnostic ignored "-Wlanguage-extension-token" #pragma clang diagnostic ignored "-Wnested-anon-...
#ifdef WIN32 #include <io.h> #else #include <unistd.h> #endif /* * This example shows an FTP upload, with a rename of the file just after * a successful upload. * * Example based on source code provided by Erick Nuwendam. Thanks!
#ifdef __cplusplus extern "C" { #endif #if defined __cplusplus || (defined __STDC__ && __STDC__) || defined WINDOWS32 # if !defined __GLIBC__ # undef __P # define __P(protos) protos # endif #else /* Not C++ or ANSI C. */ # undef __P # define __P(protos) (...
#ifdef _OPENACC # function setDevice(nprocs,myrank) use iso_c_binding use openacc implicit none include 'mpif.h' interface function gethostid() BIND(C) use iso_c_binding integer (C_INT) :: gethostid end function gethostid end interface ...
// timeRead.cpp : Defines the entry point for the console application.//include "stdafx.h"include "timeRead.h"include <fstream>include <iomanip>ifdef _DEBUGdefine new DEBUG_NEWundef THIS_FILEstatic char THIS_FILE[] = __FILE__;endif/// The one and only application objectCWinApp...