ifdefine

#ifdef #else #endif choose iOS sdk version and function?

*爱你&永不变心* 提交于 2019-12-19 03:15:18
问题 I am buliding a dark themed iOS 6 and 7 app. I understand I can call [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; to make the iOS 7 status bar suit a dark color theme application. The problem is I am going to submit my app to the App Store and currently Xcode 5 is not ready for that, so I have to use Xcode 4.6.x to do this task. However with Xcode 4.6, I am not able to compile the new method from iOS 7. I think I have to do something like ""if ios7""

#ifdef #else #endif choose iOS sdk version and function?

只愿长相守 提交于 2019-12-19 03:15:16
问题 I am buliding a dark themed iOS 6 and 7 app. I understand I can call [[UIApplication sharedApplication] setStatusBarStyle:UIStatusBarStyleLightContent]; to make the iOS 7 status bar suit a dark color theme application. The problem is I am going to submit my app to the App Store and currently Xcode 5 is not ready for that, so I have to use Xcode 4.6.x to do this task. However with Xcode 4.6, I am not able to compile the new method from iOS 7. I think I have to do something like ""if ios7""

How to do conditional .htaccess password protect

一曲冷凌霜 提交于 2019-12-10 14:27:05
问题 I'm trying to password protect a specific url using a .htaccess. Different urls point to the same files but have different workings. I now need to password protect only one url. I'm trying to do this using setenvif but it doesn't seem to work. I might not fully understand the purpose or use of the apache setenv module. This is my code what doesn't seem to work SetEnvIfNoCase Host "topasswordprotect\.domain\.com$" protecturl <IfDefine protecturl> Require valid-user AuthName "Please enter your

IfDefine and RewriteBase doesn't work well together

☆樱花仙子☆ 提交于 2019-12-02 16:50:09
问题 When I use this code, it works just okay: <IfDefine ${ServerBase}> RewriteBase ${ServerBase} </IfDefine> But when I add this, it always uses RewriteBase \ which was not what I want. <IfDefine !${ServerBase}> RewriteBase / </IfDefine> The condition was already different. One of them when ServerBase is defined and one of them is when ServerBase is NOT defined. How can I use IfDefine else pattern with RewriteBase? 回答1: IfDefine checks whether a parameter is defined or not. It doesn't check it's

IfDefine and RewriteBase doesn't work well together

我的梦境 提交于 2019-12-02 07:39:36
When I use this code, it works just okay: <IfDefine ${ServerBase}> RewriteBase ${ServerBase} </IfDefine> But when I add this, it always uses RewriteBase \ which was not what I want. <IfDefine !${ServerBase}> RewriteBase / </IfDefine> The condition was already different. One of them when ServerBase is defined and one of them is when ServerBase is NOT defined. How can I use IfDefine else pattern with RewriteBase? IfDefine checks whether a parameter is defined or not. It doesn't check it's value. You need to use it as: <IfDefine ServerBase> RewriteBase ${ServerBase} </IfDefine> <IfDefine

Apache .htaccess - applying basic authentication conditionally based on environment or hostname

时光毁灭记忆、已成空白 提交于 2019-11-28 00:48:40
My dev setup: Mac OSX 10.7.4 / Apache 2.2.21 / PHP 5.3.10 I wish to add conditional logic to my .htaccess files depending on dev vs live environment. for example i want to have authentication on the live server but not on the dev server. i have in my httpd.conf SetEnv DEV 1 I have confirmed that this var is set by checking the output from phpinfo() . then in my .htaccess file <IfDefine !DEV> AuthType Basic AuthName "password protected" AuthUserFile /path/to/.htpasswd Require valid-user </IfDefine> ...but I am still prompted for password on my local dev. it appears that the DEV variable is not

Apache .htaccess - applying basic authentication conditionally based on environment or hostname

只愿长相守 提交于 2019-11-27 04:46:18
问题 My dev setup: Mac OSX 10.7.4 / Apache 2.2.21 / PHP 5.3.10 I wish to add conditional logic to my .htaccess files depending on dev vs live environment. for example i want to have authentication on the live server but not on the dev server. i have in my httpd.conf SetEnv DEV 1 I have confirmed that this var is set by checking the output from phpinfo() . then in my .htaccess file <IfDefine !DEV> AuthType Basic AuthName "password protected" AuthUserFile /path/to/.htpasswd Require valid-user <

C++ compiling on Windows and Linux: ifdef switch [duplicate]

假装没事ソ 提交于 2019-11-26 06:13:50
问题 This question already has an answer here: How do I check OS with a preprocessor directive? 16 answers I want to run some c++ code on Linux and Windows. There are some pieces of code that I want to include only for one operating system and not the other. Is there a standard #ifdef that once can use? Something like: #ifdef LINUX_KEY_WORD ... // linux code goes here. #elif WINDOWS_KEY_WORD ... // windows code goes here. #else #error \"OS not supported!\" #endif The question is indeed a duplicate