Forums WoW Modding Support Archives Azerothcore Discord Archives [DiscordArchive] is using `#if` in Config.cpp okay or is it better to create a custom function somewhere else to keep

[DiscordArchive] is using `#if` in Config.cpp okay or is it better to create a custom function somewhere else to keep

[DiscordArchive] is using `#if` in Config.cpp okay or is it better to create a custom function somewhere else to keep

rektbyfaith
Administrator
0
01-29-2025, 11:25 AM
#1
Archived author: Tondorian • Posted: 2025-01-29T11:25:19.350000+00:00
Original source

is using `#if` in Config.cpp okay or is it better to create a custom function somewhere else to keep the code clean?
rektbyfaith
01-29-2025, 11:25 AM #1

Archived author: Tondorian • Posted: 2025-01-29T11:25:19.350000+00:00
Original source

is using `#if` in Config.cpp okay or is it better to create a custom function somewhere else to keep the code clean?

rektbyfaith
Administrator
0
01-29-2025, 11:25 AM
#2
Archived author: Tondorian • Posted: 2025-01-29T11:25:44.535000+00:00
Original source

`Config.cpp` line 40
rektbyfaith
01-29-2025, 11:25 AM #2

Archived author: Tondorian • Posted: 2025-01-29T11:25:44.535000+00:00
Original source

`Config.cpp` line 40

rektbyfaith
Administrator
0
01-29-2025, 11:26 AM
#3
Archived author: Tondorian • Posted: 2025-01-29T11:26:07.827000+00:00
Original source

it is a call into boost
rektbyfaith
01-29-2025, 11:26 AM #3

Archived author: Tondorian • Posted: 2025-01-29T11:26:07.827000+00:00
Original source

it is a call into boost

rektbyfaith
Administrator
0
01-29-2025, 12:15 PM
#4
Archived author: walkline • Posted: 2025-01-29T12:15:56.110000+00:00
Original source

I'd create a wrapper function and put the #if inside it to handle platform-specific stuff. But yeah, I'd keep that function inside the config test.

As for the wstring thing, that's weird, maybe just another platform quirk? Seems to work fine on linux/macos
rektbyfaith
01-29-2025, 12:15 PM #4

Archived author: walkline • Posted: 2025-01-29T12:15:56.110000+00:00
Original source

I'd create a wrapper function and put the #if inside it to handle platform-specific stuff. But yeah, I'd keep that function inside the config test.

As for the wstring thing, that's weird, maybe just another platform quirk? Seems to work fine on linux/macos

rektbyfaith
Administrator
0
01-29-2025, 12:20 PM
#5
Archived author: Tondorian • Posted: 2025-01-29T12:20:28.339000+00:00
Original source

yes the wstring thing is most likely because of the multibyte charset my project uses on windows
rektbyfaith
01-29-2025, 12:20 PM #5

Archived author: Tondorian • Posted: 2025-01-29T12:20:28.339000+00:00
Original source

yes the wstring thing is most likely because of the multibyte charset my project uses on windows

rektbyfaith
Administrator
0
01-29-2025, 12:23 PM
#6
Archived author: Tondorian • Posted: 2025-01-29T12:23:10.652000+00:00
Original source

https://learn.microsoft.com/en-us/cpp/bu...w=msvc-170 maybe this could be a solution https://stackoverflow.com/questions/4769...thout-a-bo
but I am not sure if this will break the code in some cases
[Embed: /utf-8 (Set source and execution character sets to UTF-8)]
Learn more about: `/utf-8` (Set source and execution character sets to UTF-8)
https://learn.microsoft.com/en-us/cpp/bu...w=msvc-170

[Embed: Possible to force CMake/MSVC to use UTF-8 encoding for source files...]
All our source code is valid UTF-8, however some users on Windows cannot build them because their system is configured for a different encoding.

Without adding a BOM to source files, is it possibl...
https://stackoverflow.com/questions/4769...thout-a-bo
rektbyfaith
01-29-2025, 12:23 PM #6

Archived author: Tondorian • Posted: 2025-01-29T12:23:10.652000+00:00
Original source

https://learn.microsoft.com/en-us/cpp/bu...w=msvc-170 maybe this could be a solution https://stackoverflow.com/questions/4769...thout-a-bo
but I am not sure if this will break the code in some cases
[Embed: /utf-8 (Set source and execution character sets to UTF-8)]
Learn more about: `/utf-8` (Set source and execution character sets to UTF-8)
https://learn.microsoft.com/en-us/cpp/bu...w=msvc-170

[Embed: Possible to force CMake/MSVC to use UTF-8 encoding for source files...]
All our source code is valid UTF-8, however some users on Windows cannot build them because their system is configured for a different encoding.

Without adding a BOM to source files, is it possibl...
https://stackoverflow.com/questions/4769...thout-a-bo

Recently Browsing
 1 Guest(s)
Recently Browsing
 1 Guest(s)