{"id":23237736,"url":"https://github.com/thecompez/predefination","last_synced_at":"2025-08-19T23:32:33.271Z","repository":{"id":157907453,"uuid":"140607227","full_name":"TheCompez/Predefination","owner":"TheCompez","description":"Some patches for __cplusplus macro.","archived":false,"fork":false,"pushed_at":"2021-12-20T14:26:53.000Z","size":61,"stargazers_count":3,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-11-19T20:53:04.019Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/TheCompez.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-11T17:18:20.000Z","updated_at":"2024-04-07T10:46:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"9cd32af6-9703-4c49-9760-62d3771dbe5e","html_url":"https://github.com/TheCompez/Predefination","commit_stats":null,"previous_names":["thecompez/predefination"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheCompez%2FPredefination","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheCompez%2FPredefination/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheCompez%2FPredefination/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TheCompez%2FPredefination/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TheCompez","download_url":"https://codeload.github.com/TheCompez/Predefination/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230374251,"owners_count":18216044,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-19T04:14:45.701Z","updated_at":"2024-12-19T04:14:46.175Z","avatar_url":"https://github.com/TheCompez.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Predefination\n**Some patches for __cplusplus macro.**\n===================================\nIn MSVC 2017 **__cplusplus** macro returns **199711** value :( that is wrong! you can use this patch for fix this problem in Microsoft **MSVC2017** compiler. :)\n\n```cpp\n#include \u003ciostream\u003e\n#include \"include/macro.hpp\"\n\nusing namespace std;\nusing namespace Utility;\n\nint main()\n{\n\n  MacroPatch mPatch;\n  cout \u003c\u003c \"Hello World!\" \u003c\u003c endl;\n  cout \u003c\u003c \"C++ Standard Version : \" \u003c\u003c __cplusplus \u003c\u003c endl;\n  cout \u003c\u003c \"C++ Standard String : \" \u003c\u003c mPatch.__cPlusPlusStandard() \u003c\u003c endl;\n#if defined(__PROJECT_MSVC__)\n  cout \u003c\u003c \"C++ Standard Version (with bug fix in MSVC : \" \u003c\u003c __PROJECT_CPP_VALUE__ \u003c\u003c endl;\n  cout \u003c\u003c \"C++ Standard Value (with bug fix in MSVC using function: \" \u003c\u003c mPatch.__cPlusPlusValue() \u003c\u003c endl;\n  cout \u003c\u003c \"C++ Standard Version (with bug fix in MSVC using function: \" \u003c\u003c mPatch.__cPlusPlusVersion() \u003c\u003c endl;\n  cout \u003c\u003c \"Compiler name using flag: \" \u003c\u003c mc.__cPlusPlus(true) \u003c\u003c endl;\n#else\n  cout \u003c\u003c \"Standard value: \" \u003c\u003c mPatch.__cPlusPlusValue() \u003c\u003c endl;\n  cout \u003c\u003c \"Standard version: \" \u003c\u003c mPatch.__cPlusPlusVersion() \u003c\u003c endl;\n#endif\n  return 0;\n}\n\n\n```\n\n**Note:**\nMake sure the default language is set to version 20 in CMakeLists.txt file.\n\n```\nCMAKE_CXX_STANDARD 20\n```\n\n**Result:** \n```\nHello World!\nC++ Standard Version : 202002\nC++ Standard String : C++20\nStandard value: 202002\nStandard version: 202002\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecompez%2Fpredefination","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthecompez%2Fpredefination","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthecompez%2Fpredefination/lists"}