preprocessor

GCC ARM Assembly Preprocessor Macro

老子叫甜甜 提交于 2019-12-09 18:27:51
问题 I am trying to use an assembly(ARM) macro for fixed-point multiplication: #define MULT(a,b) __asm__ __volatile__ ( \ "SMULL r2, r3, %0, %1\n\t" \ "ADD r2, r2, #0x8000\n\t" \ "ADC r3, r3, #0\n\t" \ "MOV %0, r2, ASR#16\n\t" \ "ORR %0, %0, r3, ASL#16" \ : "=r" (a) : "0"(a), "1"(b) : "r2", "r3" ); but when trying to compile I get error(s): expected expression before ' asm ' (You can ignore everything below this if you value your time but it would be nice if you took a look at it, the main

Xcode: Setting GCC_PREPROCESSOR_DEFINITIONS for different build configurations?

血红的双手。 提交于 2019-12-09 08:41:11
问题 I want to set GCC_PREPROCESSOR_DEFINITIONS for each of my four build configurations (Debug, Release, Ad Hoc, and Distribution.) I'd like to have a different setting for each. The screen I'm looking at is the Target Info window's "Build" tab. When I set the Configuration pop-up to "Debug" I can see my GCC_PREPROCESSOR_DEFINITIONS setting there. When I switch to "Release," or any of the other configurations, it's no longer visible. Yet when I try to add it to those configurations, it says GCC

Fortran 90 with C/C++ style macro (e.g. # define SUBNAME(x) s ## x)

强颜欢笑 提交于 2019-12-08 13:44:45
问题 I am recently working with a F90 code project. I am using gfortran (linux and MinGW) to compile it. There is something interesting in file loct.F90. # define TYPE real(4) # define SUBNAME(x) s ## x # include "loct_inc.F90" # undef SUBNAME # undef TYPE # define TYPE real(8) # define SUBNAME(x) d ## x # include "loct_inc.F90" # undef SUBNAME # undef TYPE ... The loct_inc.F90 file looks like this: subroutine SUBNAME(loct_pointer_copy_1)(o, i) ... end subroutine SUBNAME(loct_pointer_copy_1)

Can Make undefine a variable?

懵懂的女人 提交于 2019-12-08 11:48:37
问题 I'm working in an embedded system (RTXC) where I need to disable the debugger functionality which is enabled through a #define command. However, when I change the #define to undefine, compilation goes off fine, but when the linker runs, it encounters an error about a symbol not existing that belongs to the debug code (which should have been taken care of by the debugger variable not being defined). Is there any way for Make to ensure that a preprocessor variable does not get defined or stays

How to globally #define a preprocessor variable?

喜欢而已 提交于 2019-12-08 07:53:12
问题 I'm programming an Arduino sketch in C++. I want the user to be able to #define a constant directly in the sketch.ino file which will be needed to compile the code. The Arduino IDE uses a g++ compiler. Let's assume we have three files: sketch.ino sketch.h sketch.cpp In sketch.h I defined #define OPTION_1 0 #define OPTION_2 1 #define OPTION_3 2 #define OPTION_4 3 #define SLOW 0 #define FAST 1 In sketch.ino the user then defines MYOPTION: #define MYOPTION OPTION_2 In sketch.h I use the variable

Django custom context processor being called twice per request

我与影子孤独终老i 提交于 2019-12-08 06:35:49
问题 I created a simple custom context processor that needs to only be run once per request. After putting in some logging hooks I found that it is being called twice per request. Is this a known "feature" that a missed in the docs? Is it related to the number of templates in the inheritance tree? Is it a bug in 1.03? 回答1: This is not expected behavior. Context processor are executed once each time a RequestContext is instantiated). In the case of template inheritance, the same context instance is

Pre-Processing using m4

♀尐吖头ヾ 提交于 2019-12-08 02:46:47
问题 I am writing a pre-processor for Free-Pascal (Course Work) using m4. I was reading the thread at stackoverflow here and from there reached a blog which essentially shows the basic usage of m4 for pre-processing for C . The blogger uses a testing C file test.c.m4 like this: #include define(`DEF', `3') int main(int argc, char *argv[]) { printf("%d\n", DEF); return 0; } and generates processed C file like this using m4 , which is fine. $ m4 test.c.m4 > test.c $ cat test.c #include <stdio.h> int

gulp - exclude a file when minifying CSS

半城伤御伤魂 提交于 2019-12-07 12:40:11
问题 Im new to Gulp.. I have been able to successfully install and concatenate and minify my .js and .css files, however, there is one .css file which i want to exclude - print.css Ive followed the instructions here: https://www.npmjs.org/package/gulp-ignore install gulp-ignore in my local directory, and modified my gulpfile.js to: // Include gulp var gulp = require('gulp'); // Include Our Plugins var jshint = require('gulp-jshint'); var concat = require('gulp-concat'); var uglify = require('gulp

xcconfig: Different preprocessor macros for Debug/Release

≯℡__Kan透↙ 提交于 2019-12-07 08:39:02
问题 I have created and applied a simple .xcconfig file containing GCC_PREPROCESSOR_DEFINITIONS[config=Debug] = FOODEBUG GCC_PREPROCESSOR_DEFINITIONS[config=Release] = FOORELEASE and main.cpp containing #include <iostream> // This warning IS shown #if DEBUG #warning DEBUG is set to 1 #endif // This warning IS NOT shown #ifdef FOODEBUG #warning FOODEBUG is set #endif // This warning IS NOT shown #ifdef FOORELEASE #warning FOORELEASE is set #endif int main(int argc, const char * argv[]) { // insert

Is it possible to do a #define in Adobe Flex?

两盒软妹~` 提交于 2019-12-07 02:15:34
问题 I'm looking for a way to do something similar to a c/c++ #define in adobe flex. I'd like to have lots of different paths a project build can take depending on wither or not something was defined. Does such a thing exist in flex? I know there is ways to set global variables but that wont really suit my purpose. being able to have structures with numerous #ifndefined and such is really what i'm in need of. thanks! 回答1: Actually MXMLC (the compiler in the Flex SDK) does support some limited