| @@ -790,7 +790,7 @@ bool CarlaEngine::addPlugin(const BinaryType btype, const PluginType ptype, cons | |||
| } | |||
| } | |||
| QFile file(bridgeBinary.getBuffer()); | |||
| QFile file(bridgeBinary.buffer()); | |||
| if (! file.exists()) | |||
| bridgeBinary.clear(); | |||
| @@ -800,7 +800,7 @@ bool CarlaEngine::addPlugin(const BinaryType btype, const PluginType ptype, cons | |||
| { | |||
| if (bridgeBinary.isNotEmpty()) | |||
| { | |||
| plugin = CarlaPlugin::newBridge(initializer, btype, ptype, bridgeBinary.getBuffer()); | |||
| plugin = CarlaPlugin::newBridge(initializer, btype, ptype, bridgeBinary); | |||
| } | |||
| # ifdef CARLA_OS_LINUX | |||
| else if (btype == BINARY_WIN32) | |||
| @@ -816,7 +816,7 @@ bool CarlaEngine::addPlugin(const BinaryType btype, const PluginType ptype, cons | |||
| id, | |||
| "/usr/lib/dssi/dssi-vst.so", | |||
| name, | |||
| (const char*)label2, | |||
| label2, | |||
| uniqueId | |||
| }; | |||
| @@ -1468,7 +1468,7 @@ bool CarlaEngine::loadProject(const char* const filename) | |||
| } | |||
| if (sourcePort.isNotEmpty() && targetPort.isNotEmpty()) | |||
| restorePatchbayConnection(sourcePort.getBuffer(), targetPort.getBuffer()); | |||
| restorePatchbayConnection(sourcePort, targetPort); | |||
| } | |||
| break; | |||
| } | |||
| @@ -1579,7 +1579,7 @@ double CarlaEngine::getSampleRate() const noexcept | |||
| const char* CarlaEngine::getName() const noexcept | |||
| { | |||
| return pData->name.getBuffer(); | |||
| return pData->name; | |||
| } | |||
| EngineProcessMode CarlaEngine::getProccessMode() const noexcept | |||
| @@ -1892,7 +1892,7 @@ void CarlaEngine::transportRelocate(const uint64_t frame) noexcept | |||
| const char* CarlaEngine::getLastError() const noexcept | |||
| { | |||
| return pData->lastError.getBuffer(); | |||
| return pData->lastError; | |||
| } | |||
| void CarlaEngine::setLastError(const char* const error) const | |||
| @@ -68,7 +68,7 @@ struct BridgeAudioPool { | |||
| bool attach() | |||
| { | |||
| jackbridge_shm_attach(shm, filename.getBuffer()); | |||
| jackbridge_shm_attach(shm, filename); | |||
| return jackbridge_shm_is_valid(shm); | |||
| } | |||
| @@ -107,7 +107,7 @@ struct BridgeControl : public RingBufferControl<StackRingBuffer> { | |||
| bool attach() | |||
| { | |||
| jackbridge_shm_attach(shm, filename.getBuffer()); | |||
| jackbridge_shm_attach(shm, filename); | |||
| return jackbridge_shm_is_valid(shm); | |||
| } | |||
| @@ -1824,7 +1824,7 @@ private: | |||
| CARLA_SAFE_ASSERT(found); | |||
| QString qGroupName((const char*)groupName); | |||
| QString qGroupName(groupName.buffer()); | |||
| if (parsedGroups.contains(qGroupName)) | |||
| { | |||
| @@ -1843,7 +1843,7 @@ private: | |||
| int pluginId = -1; | |||
| PatchbayIcon icon = (jackPortFlags & JackPortIsPhysical) ? PATCHBAY_ICON_HARDWARE : PATCHBAY_ICON_APPLICATION; | |||
| findPluginIdAndIcon(groupName.getBuffer(), pluginId, icon); | |||
| findPluginIdAndIcon(groupName, pluginId, icon); | |||
| callback(ENGINE_CALLBACK_PATCHBAY_CLIENT_ADDED, static_cast<uint>(groupId), icon, pluginId, 0.0f, groupName); | |||
| } | |||
| @@ -1159,9 +1159,9 @@ protected: | |||
| CarlaString path(pHost->resourceDir); | |||
| path += "/carla-plugin"; | |||
| carla_stdout("Trying to start carla-plugin using \"%s\"", path.getBuffer()); | |||
| carla_stdout("Trying to start carla-plugin using \"%s\"", path.buffer()); | |||
| fUiServer.setData(path.getBuffer(), pData->sampleRate, pHost->uiName); | |||
| fUiServer.setData(path, pData->sampleRate, pHost->uiName); | |||
| fUiServer.start(); | |||
| for (uint i=0; i < pData->curPluginCount; ++i) | |||
| @@ -188,9 +188,9 @@ int CarlaEngineOsc::handleMessage(const bool isTCP, const char* const path, cons | |||
| const size_t nameSize(fName.length()); | |||
| // Check if message is for this client | |||
| if (std::strlen(path) <= nameSize || std::strncmp(path+1, fName.getBuffer(), nameSize) != 0) | |||
| if (std::strlen(path) <= nameSize || std::strncmp(path+1, fName, nameSize) != 0) | |||
| { | |||
| carla_stderr("CarlaEngineOsc::handleMessage() - message not for this client -> '%s' != '/%s/'", path, fName.getBuffer()); | |||
| carla_stderr("CarlaEngineOsc::handleMessage() - message not for this client -> '%s' != '/%s/'", path, fName.buffer()); | |||
| return 1; | |||
| } | |||
| @@ -68,12 +68,12 @@ public: | |||
| const char* getServerPathTCP() const noexcept | |||
| { | |||
| return fServerPathTCP.getBuffer(); | |||
| return fServerPathTCP; | |||
| } | |||
| const char* getServerPathUDP() const noexcept | |||
| { | |||
| return fServerPathUDP.getBuffer(); | |||
| return fServerPathUDP; | |||
| } | |||
| // ------------------------------------------------------------------- | |||
| @@ -445,7 +445,7 @@ public: | |||
| // Audio In | |||
| { | |||
| if (fDeviceName.isNotEmpty()) | |||
| std::snprintf(strBuf, STR_MAX, "Capture (%s)", (const char*)fDeviceName); | |||
| std::snprintf(strBuf, STR_MAX, "Capture (%s)", fDeviceName.buffer()); | |||
| else | |||
| std::strncpy(strBuf, "Capture", STR_MAX); | |||
| @@ -461,7 +461,7 @@ public: | |||
| // Audio Out | |||
| { | |||
| if (fDeviceName.isNotEmpty()) | |||
| std::snprintf(strBuf, STR_MAX, "Playback (%s)", (const char*)fDeviceName); | |||
| std::snprintf(strBuf, STR_MAX, "Playback (%s)", fDeviceName.buffer()); | |||
| else | |||
| std::strncpy(strBuf, "Playback", STR_MAX); | |||
| @@ -768,7 +768,7 @@ protected: | |||
| const char* const portName(fUsedMidiIns.getAt(static_cast<size_t>(portId)).name); | |||
| char newPortName[STR_MAX+1]; | |||
| std::snprintf(newPortName, STR_MAX, "%s:in-%i", (const char*)getName(), portId+1); | |||
| std::snprintf(newPortName, STR_MAX, "%s:in-%i", getName(), portId+1); | |||
| bool found = false; | |||
| uint rtMidiPortIndex; | |||
| @@ -814,7 +814,7 @@ protected: | |||
| const char* const portName(fUsedMidiOuts.getAt(static_cast<size_t>(portId)).name); | |||
| char newPortName[STR_MAX+1]; | |||
| std::snprintf(newPortName, STR_MAX, "%s:out-%i", (const char*)getName(), portId+1); | |||
| std::snprintf(newPortName, STR_MAX, "%s:out-%i", getName(), portId+1); | |||
| bool found = false; | |||
| uint rtMidiPortIndex; | |||
| @@ -387,22 +387,22 @@ public: | |||
| void getLabel(char* const strBuf) const noexcept override | |||
| { | |||
| std::strncpy(strBuf, fInfo.label.getBuffer(), STR_MAX); | |||
| std::strncpy(strBuf, fInfo.label, STR_MAX); | |||
| } | |||
| void getMaker(char* const strBuf) const noexcept override | |||
| { | |||
| std::strncpy(strBuf, fInfo.maker.getBuffer(), STR_MAX); | |||
| std::strncpy(strBuf, fInfo.maker, STR_MAX); | |||
| } | |||
| void getCopyright(char* const strBuf) const noexcept override | |||
| { | |||
| std::strncpy(strBuf, fInfo.copyright.getBuffer(), STR_MAX); | |||
| std::strncpy(strBuf, fInfo.copyright, STR_MAX); | |||
| } | |||
| void getRealName(char* const strBuf) const noexcept override | |||
| { | |||
| std::strncpy(strBuf, fInfo.name.getBuffer(), STR_MAX); | |||
| std::strncpy(strBuf, fInfo.name, STR_MAX); | |||
| } | |||
| void getParameterName(const uint32_t parameterId, char* const strBuf) const noexcept override | |||
| @@ -1669,7 +1669,7 @@ public: | |||
| const void* getExtraStuff() const noexcept override | |||
| { | |||
| return fBridgeBinary.isNotEmpty() ? fBridgeBinary.getBuffer() : nullptr; | |||
| return fBridgeBinary.isNotEmpty() ? fBridgeBinary.buffer() : nullptr; | |||
| } | |||
| bool init(const char* const filename, const char* const name, const char* const label, const char* const bridgeBinary) | |||
| @@ -166,14 +166,14 @@ void CarlaPluginThread::run() | |||
| case PLUGIN_THREAD_DSSI_GUI: | |||
| /* osc-url */ arguments << QString("%1/%2").arg(fEngine->getOscServerPathUDP()).arg(fPlugin->getId()); | |||
| /* filename */ arguments << fPlugin->getFilename(); | |||
| /* label */ arguments << fLabel.getBuffer(); | |||
| /* label */ arguments << fLabel.buffer(); | |||
| /* ui-title */ arguments << QString("%1 (GUI)").arg(fPlugin->getName()); | |||
| break; | |||
| case PLUGIN_THREAD_LV2_GUI: | |||
| /* osc-url */ arguments << QString("%1/%2").arg(fEngine->getOscServerPathUDP()).arg(fPlugin->getId()); | |||
| /* URI */ arguments << fLabel.getBuffer(); | |||
| /* ui-URI */ arguments << fExtra1.getBuffer(); | |||
| /* URI */ arguments << fLabel.buffer(); | |||
| /* ui-URI */ arguments << fExtra1.buffer(); | |||
| /* ui-title */ arguments << QString("%1 (GUI)").arg(fPlugin->getName()); | |||
| break; | |||
| @@ -184,17 +184,17 @@ void CarlaPluginThread::run() | |||
| break; | |||
| case PLUGIN_THREAD_BRIDGE: | |||
| env.insert("ENGINE_BRIDGE_SHM_IDS", fExtra2.getBuffer()); | |||
| env.insert("ENGINE_BRIDGE_SHM_IDS", fExtra2.buffer()); | |||
| env.insert("ENGINE_BRIDGE_CLIENT_NAME", name); | |||
| env.insert("ENGINE_BRIDGE_OSC_URL", QString("%1/%2").arg(fEngine->getOscServerPathUDP()).arg(fPlugin->getId())); | |||
| if (fPlugin->getType() != PLUGIN_JACK) | |||
| { | |||
| /* osc-url */ arguments << QString("%1/%2").arg(fEngine->getOscServerPathUDP()).arg(fPlugin->getId()); | |||
| /* stype */ arguments << fExtra1.getBuffer(); | |||
| /* stype */ arguments << fExtra1.buffer(); | |||
| /* filename */ arguments << fPlugin->getFilename(); | |||
| /* name */ arguments << name; | |||
| /* label */ arguments << fLabel.getBuffer(); | |||
| /* label */ arguments << fLabel.buffer(); | |||
| /* uniqueId */ arguments << QString("%1").arg(fPlugin->getUniqueId()); | |||
| } | |||
| else | |||
| @@ -211,7 +211,7 @@ void CarlaPluginThread::run() | |||
| carla_stdout("starting app.."); | |||
| qWarning() << arguments; | |||
| fProcess->start((const char*)fBinary, arguments); | |||
| fProcess->start(fBinary.buffer(), arguments); | |||
| fProcess->waitForStarted(); | |||
| switch (fMode) | |||
| @@ -291,7 +291,7 @@ void CarlaPluginThread::run() | |||
| CarlaString errorString("Plugin '" + CarlaString(fPlugin->getName()) + "' has crashed!\n" | |||
| "Saving now will lose its current settings.\n" | |||
| "Please remove this plugin, and not rely on it from this point."); | |||
| fEngine->callback(CarlaBackend::ENGINE_CALLBACK_ERROR, fPlugin->getId(), 0, 0, 0.0f, (const char*)errorString); | |||
| fEngine->callback(CarlaBackend::ENGINE_CALLBACK_ERROR, fPlugin->getId(), 0, 0, 0.0f, errorString); | |||
| } | |||
| } | |||
| break; | |||
| @@ -1171,7 +1171,7 @@ public: | |||
| CarlaString cstype(fFormat); | |||
| cstype.toLower(); | |||
| const char* const ctype(cstype.getBuffer()); | |||
| const char* const ctype(cstype.buffer()); | |||
| // --------------------------------------------------------------- | |||
| // Create the LinuxSampler Engine | |||
| @@ -3735,7 +3735,7 @@ public: | |||
| bridgeBinary += ".exe"; | |||
| #endif | |||
| QFile file(bridgeBinary.getBuffer()); | |||
| QFile file(bridgeBinary.buffer()); | |||
| if (! file.exists()) | |||
| return nullptr; | |||
| @@ -2219,9 +2219,9 @@ public: | |||
| bridgeBinary = ""; | |||
| #endif | |||
| if (QFile(bridgeBinary.getBuffer()).exists()) | |||
| if (QFile(bridgeBinary.buffer()).exists()) | |||
| { | |||
| pData->osc.thread.setOscData(bridgeBinary.getBuffer(), nullptr); | |||
| pData->osc.thread.setOscData(bridgeBinary, nullptr); | |||
| fUi.isOsc = true; | |||
| } | |||
| } | |||
| @@ -1418,7 +1418,7 @@ const char* carla_get_chunk_data(uint pluginId) | |||
| { | |||
| chunkData = QByteArray((char*)data, dataSize).toBase64().constData(); | |||
| return (const char*)chunkData; | |||
| return chunkData; | |||
| } | |||
| else | |||
| carla_stderr2("carla_get_chunk_data(%i) - got invalid chunk data", pluginId); | |||
| @@ -135,9 +135,9 @@ int CarlaBridgeOsc::handleMessage(const char* const path, const int argc, const | |||
| const size_t nameSize(fName.length()); | |||
| // Check if message is for this client | |||
| if (std::strlen(path) <= nameSize || std::strncmp(path+1, (const char*)fName, nameSize) != 0) | |||
| if (std::strlen(path) <= nameSize || std::strncmp(path+1, fName, nameSize) != 0) | |||
| { | |||
| carla_stderr("CarlaBridgeOsc::handleMessage() - message not for this client -> '%s' != '/%s/'", path, (const char*)fName); | |||
| carla_stderr("CarlaBridgeOsc::handleMessage() - message not for this client -> '%s' != '/%s/'", path, fName.buffer()); | |||
| return 1; | |||
| } | |||
| @@ -77,7 +77,7 @@ public: | |||
| const char* getServerPath() const noexcept | |||
| { | |||
| return (const char*)fServerPath; | |||
| return fServerPath; | |||
| } | |||
| // ------------------------------------------------------------------- | |||
| @@ -636,7 +636,7 @@ int main(int argc, char* argv[]) | |||
| // --------------------------------------------------------------------- | |||
| // Init plugin client | |||
| CarlaPluginClient client(useBridge, clientName.getBuffer(), bridgeBaseAudioName, bridgeBaseControlName); | |||
| CarlaPluginClient client(useBridge, clientName, bridgeBaseAudioName, bridgeBaseControlName); | |||
| if (! client.isOk()) | |||
| { | |||
| @@ -381,7 +381,7 @@ public: | |||
| // 2 channels | |||
| DISCOVERY_OUT("init", "-----------"); | |||
| DISCOVERY_OUT("name", name.getBuffer()); | |||
| DISCOVERY_OUT("name", name.buffer()); | |||
| DISCOVERY_OUT("label", label); | |||
| if (info != nullptr) | |||
| @@ -403,7 +403,7 @@ public: | |||
| // 16 channels | |||
| DISCOVERY_OUT("init", "-----------"); | |||
| DISCOVERY_OUT("name", name.getBuffer()); | |||
| DISCOVERY_OUT("name", name.buffer()); | |||
| DISCOVERY_OUT("label", label); | |||
| if (info != nullptr) | |||
| @@ -1407,10 +1407,10 @@ static void do_vst_check(void*& libHandle, const bool init) | |||
| // ----------------------------------------------------------------------- | |||
| DISCOVERY_OUT("init", "-----------"); | |||
| DISCOVERY_OUT("name", cName.getBuffer()); | |||
| DISCOVERY_OUT("label", cProduct.getBuffer()); | |||
| DISCOVERY_OUT("maker", cVendor.getBuffer()); | |||
| DISCOVERY_OUT("copyright", cVendor.getBuffer()); | |||
| DISCOVERY_OUT("name", cName.buffer()); | |||
| DISCOVERY_OUT("label", cProduct.buffer()); | |||
| DISCOVERY_OUT("maker", cVendor.buffer()); | |||
| DISCOVERY_OUT("copyright", cVendor.buffer()); | |||
| DISCOVERY_OUT("uniqueId", gVstCurrentUniqueId); | |||
| DISCOVERY_OUT("hints", hints); | |||
| DISCOVERY_OUT("audio.ins", audioIns); | |||
| @@ -1639,8 +1639,8 @@ static void do_csound_check(const char* const filename, const bool init) | |||
| csound.Reset(); | |||
| DISCOVERY_OUT("init", "-----------"); | |||
| //DISCOVERY_OUT("name", name.getBuffer()); | |||
| //DISCOVERY_OUT("label", label.getBuffer()); | |||
| //DISCOVERY_OUT("name", name.buffer()); | |||
| //DISCOVERY_OUT("label", label.buffer()); | |||
| //DISCOVERY_OUT("maker", ""); | |||
| //DISCOVERY_OUT("copyright", ""); | |||
| DISCOVERY_OUT("hints", hints); | |||
| @@ -1713,8 +1713,8 @@ static void do_fluidsynth_check(const char* const filename, const bool init) | |||
| // 2 channels | |||
| DISCOVERY_OUT("init", "-----------"); | |||
| DISCOVERY_OUT("name", name.getBuffer()); | |||
| DISCOVERY_OUT("label", label.getBuffer()); | |||
| DISCOVERY_OUT("name", name.buffer()); | |||
| DISCOVERY_OUT("label", label.buffer()); | |||
| DISCOVERY_OUT("hints", PLUGIN_IS_SYNTH); | |||
| DISCOVERY_OUT("audio.outs", 2); | |||
| DISCOVERY_OUT("midi.ins", 1); | |||
| @@ -1730,8 +1730,8 @@ static void do_fluidsynth_check(const char* const filename, const bool init) | |||
| name += " (16 outputs)"; | |||
| DISCOVERY_OUT("init", "-----------"); | |||
| DISCOVERY_OUT("name", name.getBuffer()); | |||
| DISCOVERY_OUT("label", label.getBuffer()); | |||
| DISCOVERY_OUT("name", name.buffer()); | |||
| DISCOVERY_OUT("label", label.buffer()); | |||
| DISCOVERY_OUT("hints", PLUGIN_IS_SYNTH); | |||
| DISCOVERY_OUT("audio.outs", 32); | |||
| DISCOVERY_OUT("midi.ins", 1); | |||
| @@ -53,9 +53,9 @@ protected: | |||
| if (show) | |||
| { | |||
| CarlaString path(getResourceDir() + fExtUiPath); | |||
| carla_stdout("Trying to start UI using \"%s\"", path.getBuffer()); | |||
| carla_stdout("Trying to start UI using \"%s\"", path.buffer()); | |||
| CarlaExternalUI::setData(path.getBuffer(), getSampleRate(), getUiName()); | |||
| CarlaExternalUI::setData(path, getSampleRate(), getUiName()); | |||
| CarlaExternalUI::start(); | |||
| } | |||
| else | |||
| @@ -745,7 +745,7 @@ protected: | |||
| // there seems to be a problem with this... | |||
| tmpName[4] = '0' + ((index-1+24) / 24); | |||
| #else | |||
| char* tmpBuf(const_cast<char*>(tmpName.getBuffer())); | |||
| char* tmpBuf(const_cast<char*>(tmpName.buffer())); | |||
| tmpBuf[4] = '0' + ((index-1+24) / 24); | |||
| #endif | |||
| @@ -237,7 +237,7 @@ int main() | |||
| assert(str5.rfind("haha!", &found) == str5.length()); | |||
| assert(! found); | |||
| printf("FINAL: \"%s\"\n", (const char*)str5); | |||
| printf("FINAL: \"%s\"\n", str5.buffer()); | |||
| // clear | |||
| str.clear(); | |||
| @@ -105,7 +105,7 @@ void run5Tests() | |||
| { | |||
| const MyData& my(allMyData[i]); | |||
| printf("Got data: %i %s\n", my.id, (const char*)my.str); | |||
| printf("Got data: %i %s\n", my.id, my.str.buffer()); | |||
| } | |||
| } | |||
| @@ -143,7 +143,7 @@ int main() | |||
| { | |||
| const MyData& my(it.getValue()); | |||
| printf("FOR DATA!!!: %i %s\n", my.id, (const char*)my.str); | |||
| printf("FOR DATA!!!: %i %s\n", my.id, my.str.buffer()); | |||
| if (my.id == 1) | |||
| { | |||
| @@ -110,7 +110,7 @@ protected: | |||
| { | |||
| if (fOldBuffer.isNotEmpty()) | |||
| { | |||
| fCallback(fCallbackPtr, CarlaBackend::CALLBACK_DEBUG, 0, 0, 0, 0.0f, (const char*)fOldBuffer); | |||
| fCallback(fCallbackPtr, CarlaBackend::CALLBACK_DEBUG, 0, 0, 0, 0.0f, fOldBuffer); | |||
| fOldBuffer = nullptr; | |||
| } | |||
| @@ -203,11 +203,10 @@ public: | |||
| if (fBuffer == _null()) | |||
| return; | |||
| try { | |||
| delete[] fBuffer; | |||
| } catch(...) {} | |||
| std::free(fBuffer); | |||
| fBuffer = nullptr; | |||
| fBuffer = nullptr; | |||
| fBufferLen = 0; | |||
| } | |||
| // ------------------------------------------------------------------- | |||
| @@ -257,7 +256,7 @@ public: | |||
| tmp1.toLower(); | |||
| tmp2.toLower(); | |||
| return (std::strstr((const char*)tmp1, (const char*)tmp2) != nullptr); | |||
| return (std::strstr(tmp1, tmp2) != nullptr); | |||
| #endif | |||
| } | |||
| @@ -577,12 +576,10 @@ public: | |||
| // ------------------------------------------------------------------- | |||
| // public operators | |||
| #if 0 | |||
| operator const char*() const noexcept | |||
| { | |||
| return fBuffer; | |||
| } | |||
| #endif | |||
| char& operator[](const size_t pos) const noexcept | |||
| { | |||
| @@ -698,7 +695,7 @@ private: | |||
| * | |||
| * Notes: | |||
| * - Allocates string only if 'strBuf' is not null and new string contents are different | |||
| * - If 'strBuf' is null 'size' must be 0 | |||
| * - If 'strBuf' is null, 'size' must be 0 | |||
| */ | |||
| void _dup(const char* const strBuf, const size_t size = 0) noexcept | |||
| { | |||
| @@ -709,21 +706,13 @@ private: | |||
| return; | |||
| if (fBuffer != _null()) | |||
| { | |||
| try { | |||
| delete[] fBuffer; | |||
| } catch(...) {} | |||
| } | |||
| std::free(fBuffer); | |||
| fBufferLen = (size > 0) ? size : std::strlen(strBuf); | |||
| fBuffer = (char*)std::malloc(fBufferLen+1); | |||
| try { | |||
| fBuffer = new char[fBufferLen+1]; | |||
| } | |||
| catch(...) { | |||
| _init(); | |||
| return; | |||
| } | |||
| if (fBuffer == nullptr) | |||
| return _init(); | |||
| std::strcpy(fBuffer, strBuf); | |||
| @@ -738,7 +727,7 @@ private: | |||
| return; | |||
| CARLA_SAFE_ASSERT(fBuffer != nullptr); | |||
| delete[] fBuffer; | |||
| std::free(fBuffer); | |||
| _init(); | |||
| } | |||
| @@ -90,7 +90,7 @@ public: | |||
| { | |||
| #if defined(__GLIBC__) && (__GLIBC__ * 1000 + __GLIBC_MINOR__) >= 2012 | |||
| if (fName.isNotEmpty()) | |||
| pthread_setname_np(threadId, fName.getBuffer()); | |||
| pthread_setname_np(threadId, fName); | |||
| #endif | |||
| pthread_detach(threadId); | |||