Skip to content

Instantly share code, notes, and snippets.

@hcfcoder
Created March 18, 2023 17:26
Show Gist options
  • Save hcfcoder/9d3eb3212ce39bccd5dac95edf097d5a to your computer and use it in GitHub Desktop.
Save hcfcoder/9d3eb3212ce39bccd5dac95edf097d5a to your computer and use it in GitHub Desktop.
Using Regex makes the program crash, without even starting
#include <stdio.h>
#include <stdlib.h>
#include <hal/xbox.h>
#include <hal/video.h>
#include <hal/debug.h>
#include <SDL.h>
//INCLUDING THESE LINES MAKES THE PROGRAM CRASH WITHOUT EVEN STARTING
#include <regex>
static std::regex _includeRegex = std::regex("\\s*#include\\s+([\\\\/A-Za-z0-9_\\-\\.]+)");
//INCLUDING THESE LINES MAKES THE PROGRAM CRASH WITHOUT EVEN STARTING
void vdLog(char *msg)
{
debugPrint(msg);
SDL_Delay(3000);
}
int main(int argc, char* argv[])
{
XVideoSetMode(640, 480, 32, REFRESH_DEFAULT);
SDL_LogSetPriority(SDL_LOG_CATEGORY_APPLICATION, SDL_LOG_PRIORITY_INFO);
if (SDL_VideoInit(NULL) < 0)
{
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Couldn't initialize SDL video.\n");
}
//This message is not displayed, because the program is not even executing
vdLog("START!\n");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment