Adding the Semaphore max value as a define if it is not defined.