refactor: rename PIP_NO_\* to PIP_HAS_\* with inverted logic
All feature flags now use positive naming (enabled by default): - PIP_HAS_FILESYSTEM, PIP_HAS_THREADS, PIP_HAS_SOCKET - PIP_HAS_PROCESS, PIP_HAS_DYNLIB, PIP_HAS_FFT, PIP_HAS_SERIAL Preprocessor guards inverted: - #ifndef PIP_NO_X → #ifdef PIP_HAS_X - #ifdef PIP_NO_X → #ifndef PIP_HAS_X CMake options default ON instead of OFF. Platform blocks set flags OFF to disable features. 85 files transformed via Python script + 2 manual fixes.
This commit is contained in:
@@ -207,7 +207,7 @@ PIVector<PISystemInfo::MountInfo> PISystemInfo::mountInfo(bool ignore_cache) {
|
||||
PIString confDir() {
|
||||
return
|
||||
#ifdef WINDOWS
|
||||
# ifndef PIP_NO_FILESYSTEM
|
||||
# ifdef PIP_HAS_FILESYSTEM
|
||||
PIDir::home().path() + "/AppData/Local"
|
||||
# else
|
||||
""
|
||||
@@ -215,7 +215,7 @@ PIString confDir() {
|
||||
#elif defined(ANDROID)
|
||||
""
|
||||
#else
|
||||
# ifndef PIP_NO_FILESYSTEM
|
||||
# ifdef PIP_HAS_FILESYSTEM
|
||||
PIDir::home().path() + "/.config"
|
||||
# else
|
||||
""
|
||||
@@ -242,7 +242,7 @@ PIString PISystemInfo::machineKey() {
|
||||
PISystemInfo * si = instance();
|
||||
PIByteArray salt;
|
||||
PIString conf = confDir() + "/.pip_machine_salt";
|
||||
#ifndef PIP_NO_FILESYSTEM
|
||||
#ifdef PIP_HAS_FILESYSTEM
|
||||
if (PIFile::isExists(conf)) salt = PIFile::readAll(conf);
|
||||
if (salt.size_s() != SALT_SIZE) {
|
||||
salt = generateSalt();
|
||||
|
||||
Reference in New Issue
Block a user