// This work is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License. // To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or send a // letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA. // Persistence of Vision Ray Tracer version 3.8 Include File. // File: version.inc // Last updated: 15 February 2022 // Description: This include can be run by any recent version of POV-Ray to // reasonably test whether the fork constants are available and if so whether // the fork is 'povr' otherwise errors are issued and parsing stops. Where // file_exist for forkversion.inc returns false a warning is issued indicating // the running POV-Ray version is probably a commonly released one, and the // parsing continues. // The thinking is versions of POV-Ray including official ones would include // some flavor of version.inc. It would at a minimum test for forkversion.inc // and report appropriately. Where forkversion.inc part of the published // version package, it would be expected fork constants to exist too. Those // would make available standard information about the program name/fork name // and version information - this includes the official code. // The version.inc should always parse no matter the POV-Ray version being run // unless something is found amiss. It's hoped the official code releases / // compiles of POV-Ray will eventually work out a means to provide an // indication the program being run aligns with code/executables released by // the POV-Ray team. // See forkversion.inc for more information. #ifndef (Version_include_temp) #declare Version_include_temp = version; // Currently useless, but safe. #ifdef (View_POV_Include_Stack) #debug "including version.inc\n" #end #if (file_exists("Forkversion.inc")) // #debug "Yes, we can find a forkversion.inc somewhere." #include "forkversion.inc" #if (Have_fork_constants()) #if (!strcmp(fork_str(0),"povr")) #declare Fork_povr = true; #declare Fork_Release = fork_val(0); #declare Fork_Major = fork_val(3); #declare Fork_Minor = fork_val(4); #declare Fork_Revision = fork_val(5); #declare Fork_Patch = fork_val(6); #if (version<3.8) #warning concat("The povr fork requires #version 3.8 or later. The version is currently: ",str(version,4,3)) #end #debug concat("The povr release ",str(Fork_Release,0,0)," (",fork_str(1),") version is: v", str(Fork_Major,0,0),".",str(Fork_Minor,0,0),".",str(Fork_Revision,0,0),".",str(Fork_Patch,0,0),"\n") #else #error "The fork_str(0) string constant is not 'povr'." #end #else #error "The fork_str() and fork_ver() constants not found." #end #else // TODO. Is there some way for officially released POV-Ray code to determine what's // being run aligns with particular releases and/or documentation? #debug "\n" #warning "Cannot find forkversion.inc. Likely, a common release of POV-Ray." #debug "\n" #debug "The running program might also be a POV-Ray fork without fork constants.\n" #debug "\n" #declare Fork_povr = false; #declare Fork_Release = 999999; #declare Fork_Major = 999999; #declare Fork_Minor = 999999; #declare Fork_Revision = 999999; #declare Fork_Patch = 999999; #end //#error "\nDebugging stop\n" #version Version_include_temp; #end // Example code using this file which would be placed near the start of a scene. // #if (file_exists("version.inc")) // #include "version.inc" // #end // #if (!Fork_povr) // This POV-Ray SDL code requires the povr fork. // #error "This POV-Ray SDL code requires the povr fork." // #end